📄 netkite.1
字号:
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14.\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings. \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote. | will give a.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'.\" expand to `' in nroff, nothing in troff, for use with C<>..tr \(*W-|\(bv\*(Tr.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\. ds -- \(*W-. ds PI pi. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch. ds L" "". ds R" "". ds C` "". ds C' ""'br\}.el\{\. ds -- \|\(em\|. ds PI \(*p. ds L" ``. ds R" '''br\}.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD. Of course, you'll have to process the.\" output yourself in some meaningful fashion..if \nF \{\. de IX. tm Index:\\$1\t\\n%\t"\\$2"... nr % 0. rr F.\}.\".\" For nroff, turn off justification. Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..hy 0.if n .na.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear. Run. Save yourself. No user-serviceable parts.. \" fudge factors for nroff and troff.if n \{\. ds #H 0. ds #V .8m. ds #F .3m. ds #[ \f1. ds #] \fP.\}.if t \{\. ds #H ((1u-(\\\\n(.fu%2u))*.13m). ds #V .6m. ds #F 0. ds #[ \&. ds #] \&.\}. \" simple accents for nroff and troff.if n \{\. ds ' \&. ds ` \&. ds ^ \&. ds , \&. ds ~ ~. ds /.\}.if t \{\. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u". ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}. \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E. \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'. \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\. ds : e. ds 8 ss. ds o a. ds d- d\h'-1'\(ga. ds D- D\h'-1'\(hy. ds th \o'bp'. ds Th \o'LP'. ds ae ae. ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "NETKITE 1".TH NETKITE 1 "2007-05-13" "perl v5.8.4" "User Contributed Perl Documentation".SH "NAME"netkite \- custom upgrade system.SH "SYNOPSIS".IX Header "SYNOPSIS"netkite [\s-1HOST\s0] [\s-1OPTIONS\s0].SH "DESCRIPTION".IX Header "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..PPEach 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..PPThe client specifies a module name when connecting to the server,and checks with md5 sum whether the files in the received module require upgrade..PPWith the \fBrule file\fR corresponded to the \fBupgrade file\fR, the server controls the client's behavior of upgrade,which include four actions such as creating and deleting.Rule file, which suffix is \fB.rule\fR, is in the same directory and with the same name as \fBupgrade file\fR.Refer to relevant description for the rules of config file and detailed examples.eg: the directory structure is as follows:.PP.Vb 8\& root/\& l\- module_a/\& l\- father/\& l\- file1\& l\- file1.rule\& l\- son\& l\- file2\& l\- file2.rule.Ve.PPIf the client specifies module \fBfather\fR, the server will deliver \fIfile1\fR to the client and trace back to root, then the communication ends;if the client specifies module \fBson\fR, the server will first deliver \fIfile2\fR to the client. \fBson\fR is inherited from \fBfather\fR, then the server will deliver \fIfile1\fR to the client. Create necessary paths if it inexistent after getting files..PPThe default parameter of the client operates only for once, or the operation can be circulated by changing the parameter.During the circulation, signal \fB\s-1SIGALRM\s0\fR can help compel the client to start a new connection..PPIf the command line parameter is the same as the config file's, then it has high \s-1PRI\s0..PPIf turn off overlap mode (default), the client ignore later more than one file of the same object (same \fBdev\fR and same \fBname\fR specify by rule file)..SH "OPTIONS".IX Header "OPTIONS"The command line parameters shall be in one-to-one correspondence with the ones of config file; refer to \s-1CONFIG\s0 \s-1FILE\s0 for the default value of options..PP\&\fB\-p\fR \fIport\fR specify communication port.PP\&\fB\-t\fR \fIsecond\fR set the timeout in seconds.PP\&\fB\-x\fR \fIlogfile\fR specify the absolute path of log file.PP\&\fB\-f\fR \fIconf\fR sepcify config file.PP\&\fB\-r\fR \fIroot\fR specify the absolute path of root directory for server.PP\&\fB\-b\fR \fIbacklog\fR set listening backlog for server.PP\&\fB\-d\fR \fIsecond\fR indicate executive cycle for client.PP\&\fB\-m\fR \fImodule\fR specify a name of accepted module for client.PP\&\fB\-X\fR \fItmp\fR specify the absolute path of tmp directory for client.PP\&\fB\-s\fR switch to server mode.PP\&\fB\-c\fR switch to client mode, default.PP\&\fB\-v\fR print current version.PP\&\fB\-h\fR print this help page.PP\&\fB\-H\fR print config file help page.PP\&\fB\-g\fR turn off log record.PP\&\fB\-G\fR turn on log record, default.PP\&\fB\-u\fR turn on overlap mode.PP\&\fB\-U\fR turn off overlap mode, default.PP\&\fB\-o\fR display available configuration.SH "RULE FILE".IX Header "RULE FILE".Sh "\s-1NAMING\s0".IX Subsection "NAMING"With the suffix \fB.rule\fR, it is in the same directory and with the same name as \fBupgrade file\fR..Sh "\s-1FORMAT\s0".IX Subsection "FORMAT"Each line of \fBrule file\fR is either a comment or a directive.A Comment line starts with a # and is ignored.A directive line has the format:.PP\&\fBkey\fR = \fIvalue\fR.PPThe valid key and its value are:.PP\&\fBname\fR = \fI/root/file\fR The position and name of the direction upgrade file stored in the client..PP\&\fB \fR = \fI/root/dir/\fR 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..PP\&\fBact\fR = \fIcreate\fR The act of direction file upgrade, if it is not specified, default it as \fIcreate\fR. Get the different files from the server no matter whether a file or directly exists in the name specified position or not..PP\&\fB \fR = \fIremove\fR Remove the file or directly existing in the name specified position; if the directory exists, it shall be empty..PP\&\fB \fR = \fIupdate\fR Update the file or directory if existing; if the directory exists in the name specified position, it shall be empty..PP\&\fB \fR = \fIunique\fR Update from the server only if no file or directory exists in the name specified position..PP\&\fBdev\fR = \fI/dev/hdb1\fR 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..PP\&\fBmd5\fR = \fId41d8cd98f00b204e9800998ecf8427e\fR If this field exists, the server will not calculate the \s-1MD5\s0 of the target file dynamically..SH "CONFIG FILE".IX Header "CONFIG FILE"The default config file is \fI/etc/netkite.conf\fR, the format is like \fB\s-1RULE\s0 \s-1FILE\s0\fR.Type \f(CW\*(C`netkite \-H\*(C'\fR to print following contents; and original config file can be generated though the redirection to file..PP.Vb 2\& # specify remote the server address in the client mode\& address = 127.0.0.1.Ve.PP.Vb 2\& # specify listening network interface in the server mode\& interface = 0.0.0.0.Ve.PP.Vb 2\& # switch to the server or the client mode\& the server_mode = no.Ve.PP.Vb 2\& # turn on/off log record\& log_enable = yes.Ve.PP.Vb 2\& # specify communication port\& port = 7002.Ve.PP.Vb 2\& # set the timeout in seconds\& timeout = 75.Ve.PP.Vb 2\& # specify the absolute path of log file\& log_file = /var/log/netkite.log.Ve.PP.Vb 2\& # specify the absolute path of root directory for the server\& root = /var/netkite.Ve.PP.Vb 2\& # set listening backlog for the server\& backlog = 1024.Ve.PP.Vb 3\& # indicate executive cycle for the client,\& # if 0, then run one time only\& idle = 0.Ve.PP.Vb 2\& # specify a name of accepted module for the client\& module = test.Ve.PP.Vb 2\& # specify the absolute path of tmp directory for the client\& tmp_path = /tmp.Ve.SH "EXAMPLES".IX Header "EXAMPLES".Sh "In the server mode".IX Subsection "In the server mode".RS 4At first, netkite will chroot to root, then create this directory in case it does not already exist..RE.IP "1." 4Create the server root directory /var/netkite:.Sp.Vb 1\& sh\-2.05b# mkdir /var/netkite.Ve.IP "2." 4Create test module \fBfather\fR and \fBson\fR:.Sp.Vb 2\& sh\-2.05b# mkdir /var/netkite/father\& sh\-2.05b# mkdir /var/netkite/father/son.Ve.IP "3." 4Put test file to \fBfather\fR and \fBson\fR.Sp.Vb 3\& 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.Ve.IP "4." 4Create rule file for upgrade file as follows:.Sp.Vb 3\& sh\-2.05b# cat /var/netkite/father/regular.rule\& name = /misc/test1\& act = create.Ve.Sp.Vb 2\& sh\-2.05b# cat /var/netkite/father/dir.rule\& name = /misc/test2/.Ve.Sp.Vb 3\& sh\-2.05b# cat /var/netkite/father/son/link.rule\& name = /misc/test3\& dev = /dev/hdb1.Ve.IP "5." 4Execute netkite in server mode:.Sp.Vb 1\& sh\-2.05b# netkite \-s.Ve.Sh "In the client mode".IX Subsection "In the client mode".IP "a." 4Specify the accepted module name as \fBfather\fR and the ip address10.0.0.1 of the server, and execute netkite:.Sp.Vb 1\& sh\-2.05b# netkite 10.0.0.1 \-m father.Ve.SpThe client gets file \fIregular\fR and empty directory \fIdir\fR from the server, which be stored in \fI/misc/\fR;then \fIregular\fR is named as \fItest1\fR and \fIdir\fR \fItest2\fR. If no \fI/misc/\fR exists, the client will create it..IP "b." 4Specify the accepted module name as \fBson\fR:.Sp.Vb 1\& sh\-2.05b# netkite 10.0.0.1 \-m son.Ve.SpThe client gets symbol link \fIlink\fR and stores it in \fI/misc/\fR under partition \fI/dev/hdb1\fR, naming it as \fItest3\fR.Due to the inheritable relation between the modules, the two files in \fBfather\fR will also be got later..SH "LOG FORMAT".IX Header "LOG FORMAT".Sh "The server".IX Subsection "The server"Return_code state_info client_addr [module name] transmit_file_name.Sh "The client".IX Subsection "The client"Return_code state_info action_info device_name\->receive_file_name.Sh "Action".IX Subsection "Action".Vb 1\& 1. Action info includes four states:.Ve.PP.Vb 2\& upgrade:\& The content of file is modified..Ve.PP.Vb 2\& change:\& The attribute of file is changed..Ve.PP.Vb 2\& remove:\& The file is removed..Ve.PP.Vb 2\& finish:\& Upgrade finished (only on client)..Ve.PP.Vb 1\& 2. If dev is not specified in rule file, device_name will not appear in log file..Ve.SH "NOTES".IX Header "NOTES"After the temp file receiving completed, the client blocks all signals when replacing the destination file..SH "FILES".IX Header "FILES"\&\fI/etc/netkite.conf\fR Default config file..PP\&\fI/var/netkite\fR Default root directory of the server..PP\&\fI/var/log/netkite.log\fR Default Log file..PP\&\fI/tmp\fR Default temp file directory of the client..SH "BUGS".IX Header "BUGS".IP "1." 4If 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..IP "2." 4Considering the security, the removal of non-empty directory is not supported now..IP "3." 4The server does not log the files removed by the client..IP "4." 4If server provide files more then 65535, the client hash table should full, non overlap mode maybe invalid..PPBug report to <binary@eniak.org> please, it's my nosh :).SH "THANKS".IX Header "THANKS"Hellen Zhao help me translate this man page, thanks very much!.SH "AUTHOR".IX Header "AUTHOR"Binary Ma.SH "SEE ALSO".IX Header "SEE ALSO"\&\*(L"netkite \-h\*(R" and \*(L"netkite \-H\*(R"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -