📄 readme
字号:
NAME netkite - custom upgrade systemSYNOPSIS netkite [HOST] [OPTIONS]DESCRIPTION Netkite is a network upgrade system that integrates the server and the client. It can be used in system patching. Support all the file types of linux. Each directory under the root of the server is called a module, the files included in which can be gotten by the client; the module is inheritable. The client specifies a module name when connecting to the server, and checks with md5 sum whether the files in the received module require upgrade. With the rule file corresponded to the upgrade file, the server controls the client’s behavior of upgrade, which include four actions such as creating and deleting. Rule file, which suffix is .rule, is in the same directory and with the same name as upgrade file. Refer to relevant description for the rules of config file and detailed examples. eg: the directory structure is as follows: root/ l- module_a/ l- father/ l- file1 l- file1.rule l- son l- file2 l- file2.rule If the client specifies module father, the server will deliver file1 to the client and trace back to root, then the communication ends; if the client specifies module son, the server will first deliver file2 to the client. son is inherited from father, then the server will deliver file1 to the client. Create necessary paths if it inexistent after getting files. The default parameter of the client operates only for once, or the operation can be circulated by changing the parameter. During the circulation, signal SIGALRM can help compel the client to start a new connection. If the command line parameter is the same as the config file’s, then it has high PRI.OPTIONS The command line parameters shall be in one-to-one correspondence with the ones of config file; refer to CONFIG FILE for the default value of options. -p *port* specify communication port -t *second* set the timeout in seconds -x *logfile* specify the absolute path of log file -f *conf* sepcify config file -r *root* specify the absolute path of root directory for server -b *backlog* set listening backlog for server -d *second* indicate executive cycle for client -m *module* specify a name of accepted module for client -X *tmp* specify the absolute path of tmp directory for client -s switch to server mode -c switch to client mode, default -v print current version -h print this help page -H print config file help page -g turn off log record -G turn on log record, default -o display available configurationRULE FILE NAMING With the suffix .rule, it is in the same directory and with the same name as upgrade file. FORMAT Each line of rule file is either a comment or a directive. A Comment line starts with a # and is ignored. A directive line has the format: key = value The valid key and its value are: name = /root/file The position and name of the direction upgrade file stored in the client. = /root/dir/ Since directory is explained as the module name, if an empty directory will be provided for the client, then add a slash behind the file. act = create The act of direction file upgrade, if it is not specified, default it as create. Get the different files from the server no matter whether a file or directly exists in the name specified position or not. = remove Remove the file or directly existing in the name specified position; if the directory exists, it shall be empty. = update Update the file or directory if existing; if the directory exists in the name specified position, it shall be empty. = unique Update from the server only if no file or directory exists in the name specified position. dev = /dev/hdb1 Which device dose the direction file exist in; if it is not specified, default it as in system current directory structure, it is the most commonly used measuree.CONFIG FILE The default config file is /etc/netkite.conf, the format is like RULE FILE. Type "netkite -H" to print following contents; and original config file can be generated though the redirection to file. # specify remote the server address in the client mode address = 127.0.0.1 # specify listening network interface in the server mode interface = 0.0.0.0 # switch to the server or the client mode the server_mode = no # turn on/off log record log_enable = yes # specify communication port port = 7002 # set the timeout in seconds timeout = 75 # specify the absolute path of log file log_file = /var/log/netkite.log # specify the absolute path of root directory for the server root = /var/netkite # set listening backlog for the server backlog = 1024 # indicate executive cycle for the client, # if 0, then run one time only idle = 0 # specify a name of accepted module for the client module = test # specify the absolute path of tmp directory for the client tmp_path = /tmp EXAMPLES In the server mode At first, netkite will chroot to root, then create this directory in case it does not already exist. 1. Create the server root directory /var/netkite: sh-2.05b# mkdir /var/netkite 2. Create test module father and son: sh-2.05b# mkdir /var/netkite/father sh-2.05b# mkdir /var/netkite/father/son 3. Put test file to father and son sh-2.05b# echo "hello" > /var/netkite/father/regular sh-2.05b# echo "hello" > /var/netkite/father/dir sh-2.05b# ln -s /root /var/netkite/father/son/link 4. Create rule file for upgrade file as follows: sh-2.05b# cat /var/netkite/father/regular.rule name = /misc/test1 act = create sh-2.05b# cat /var/netkite/father/dir.rule name = /misc/test2/ sh-2.05b# cat /var/netkite/father/son/link.rule name = /misc/test3 dev = /dev/hdb1 5. Execute netkite in server mode: sh-2.05b# netkite -s In the client mode a. Specify the accepted module name as father and the ip address 10.0.0.1 of the server, and execute netkite: sh-2.05b# netkite 10.0.0.1 -m father The client gets file regular and empty directory dir from the server, which be stored in /misc/; then regular is named as test1 and dir test2. If no /misc/ exists, the client will create it. b. Specify the accepted module name as son: sh-2.05b# netkite 10.0.0.1 -m son The client gets symbol link link and stores it in /misc/ under partition /dev/hdb1, naming it as test3. Due to the inheritable relation between the modules, the two files in father will also be got later.LOG FORMAT The server return_code state_info client_addr [module name] transmit_file_name The client return_code state_info action_info device_name->receive_file_name Note: 1. Action_info includes three states: upgrade: The content of file is modified. change: The attribute of file is changed. remove: The file is removed. 2. If dev is not specified in rule file, device_name will not appear in log file. FILES /etc/netkite.conf Default config file. /var/netkite Default root directory of the server. /var/log/netkite.log Default Log file. /tmp Default temp file directory of the client.BUGS 1. If no dependence relation between upgrade files exists, the demand for this shall be realized by the feature that child module takes precedence of father module. 2. Considering the security, the removal of non-empty directory is not supported now. 3. The server does not log the files removed by the client. Bug report to <binary@eniak.org>.THANKS Hellen Zhao help me translate this man page, thanks very much!AUTHOR Binary MaSEE ALSO "netkite -h" and "netkite -H"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -