--- /dev/null Fri May 23 21:21:14 2003 +++ README.en Fri May 23 21:01:04 2003 @@ -0,0 +1,319 @@ +Nicmond -- Network interface supervisory PROGRAM + +Past record: +Version 1.1 Document first edition + +------------------------------------- +NOTE: This is my's attempt at translating Japanese with +the help of an automatic web-based tool (AltaVista's Babelfish). +As will shortly become evident, I don't know Japanese. If you do, +and would like to help with the translation of this document +or the manpages, let me know. Dan Pelleg . +------------------------------------ + +1. Summary + +This PROGRAM watches the link status of the network interface, when detecting the change of state, +executes the processing which is appointed automatically. The processing +which it makes execute is optionally appointment possible with the +setting file. + +2. Hardware requirement Operation is verified with +environment below. +FreeBsd 5.0-dp1 + 4.6-RC +NetBsd 1.6-ZC + +3. Those which are included in distribution + +Makefile The script in order to delete the +IPv6 route which the +README -- this file +nicmond.c -- the Source +nicmond.conf -- the Sample configuration file +nicmond.sh -- the example +cleanup_inet6_route of the script for automatic start -- you have used +in the Sample configuration file, has become surplus +-- the Makefile + +4. Compile and install + +The make please do inside the directory which +develops the Archive. The make install by hand please do the Install, or +do in the optional directory. Furthermore, with the Makefile and the +nicmond.conf and the nicmond.sh which bundled are done, the nicmond (the +execution file) to the /usr/local/sbin/, the nicmond.conf (the setting +file) to the /usr/local/etc/, the nicmond.sh (the starting script) to +the /usr/local/etc/rc.d/, the cleanup_inet6_route (the auxiliary script) +you suppose the thing which the install is done to the +/usr/local/libexec/. When the install it does in the path which differs, +appropriateness compilation is necessary. The case of the Compile, by +the fact that the following macro is defined, it is possible to change +operation. The case of the call of the + +USE_SYSTEM Action, the execvp (3) +in the change the system (3) it reaches the point where you use. The +case of the call of the + +WITHOUT_ADDR Action, it stops doing the +processing regarding the IP address. When IP address variable is +included in the Command section, it is handled does not do substitution +operation as the mere character string. + +5. Option when starting It does +starting the Nicmond, as follows. + +Nicmond [ options ] [ ... ] + +Those +below it is appointment possible in the Options. Even with when state +cannot be acquired + +-a vis-a-vis the interface which is appointed, that +interface is not deleted from the supervisory list. When this option is +not appointed, when the interface which cannot acquire state normally is +removed from the supervisory list, the supervisory list becomes the sky, +PROGRAM ends. + +-d it executes with the Debug mode. Besides the fact that +operation stops moving to the background, it reaches the point where +several message are indicated with addition. + +-d -d it executes with the +Dummy mode. In addition to the Debug mode, really it stops executing the +action at the time of the up/down. It is convenient to the verification +of the contents which are executed. + +-f the place and name of the setting +file are appointed. With the Default the nicmond.conf of the current +directory is used. + +-i the interval which acquires the state of the +Interface is appointed (the unit: Second). * At present time, the +appointment with this option compared to, designated direction in the +setting file takes precedence. + +-p You output your own PID to the file +which it appoints. With the Default output is not done. + +-s { 0|1 } +initial condition of the Interface is appointed. " 0 " the down, " 1 " +the up is shown. This option is applied commonly to all interface which +are appointed. The Default is " the down ". + +When -v it executes with the +Debug mode or the dummy mode, it reaches the point where the message is +outputted more. Usually when (the daemon) it executes with the mode, it +does not have meaning. + +[:] In addition, it is possible as follows to give +initial condition individually, at the time of appointing the interface. +As for state " 0 " (down)" 1 " (up). + +Example: fxp0:1 + +The default of +state the default ("-s " setting of the option) you follow. Appointment +of the state here " -s " than the appointment with the option takes +precedence. + +6. Setting file + +You describe the setting file, with type +below. + + + + You divide between the Keyword and value, with blank or TAB +letter. In addition, each keyword must start from the line head. There +are those below in the Keyword. + + +interval The polling interval which watches the + interval Interface is appointed (the unit: Second). + +resense Correct value is + appointment possible. The case where state change of the resense + Interface is detected verification interval is appointed (the unit: + Second). 0 or correct value it is appointment possible. When 0 is + appointed, it stops doing the resense. As for details later description. + +facility The facility of syslog output when it operates with the facility Daemon + mode is appointed. The Default is " the daemon ". + +fatal The case where fatal + phenomenon occurs for the execution of fatal PROGRAM, the priority of + syslog output is set. The Default is " the emerg ". + +critical The case where fatal + phenomenon occurs at the time of the state detection of the critical + Interface the priority of syslog output is set. The Default is " the + crit ". + +notice The phenomenon whose the notice relatively criticality is high + (start * end of PROGRAM and detection et cetera of state change of the + interface) the priority of syslog output when it occurs is set. The + Default is " the notice ". + +interface The information whose info criticality is low + (contents of the action) the case where it outputs the proirity of + syslog output is set. The Default is " the info ". + +Start of description +of the action regarding the interface of the interface supervisory +object is declared. Interface name is taken in argument. When " the none +" is appointed vis-a-vis the Facility, syslog output is not done +altogether. In addition, when " the none " is appointed vis-a-vis the +fatal/critical/notice/info, it stops doing syslog output concerning the +information of particular classification. Furthermore, when the same +keyword the plural times it is described, the contents which are +appointed afterwards become effective. However, searching from the +forefront of the file concerning the interface, you use those which +first you discover. Continuing in " interface " line, you describe the +action for the change of the Link status, with type below. The Event is +" the up " or " the down ". Corresponding to the event in the Command, +you describe the command which it executes. Plural you can describe +Action line, but (including first line) the line head by all means has +had to have started with TAB letter. You divide the Event and the +command with blank or TAB letter. When the line where letter other than +TAB letter is written on the line head appears, those which description +of the action ends it interprets. However, empty line (or only notes the +line which is not written) it is ignored (it skips). At the time of the +description of the Command, it is possible to use the variable below. It +is substituted to + + $device Interface name. + + $myaddr4 +It is substituted to the IPv4 +address which the particular interface has that time. When the +Interface has the plural IPv4 address, each one time it means that the +command is executed that vis-a-vis respectively. + + $myaddr6 +It is substituted to the IPv6 address which the particular interface has that time. +When the Interface has the plural IPv6 address, each one time it means +that the command is executed that vis-a-vis respectively. However, the +link-local address does not become the object of processing. + +You can describe the $device and the $myaddr4/$myaddr6 to the same action, but +as for the $myaddr4 and the $myaddr6 it is not possible to exist +together to the identical action. In addition, when we would like to +give variable identifier itself to the command, putting " the \ " before +" the $, " the escape it is possible to do. Furthermore, to the future +it is considered notes from " # " letter in the setting file, is +ignored. By empty line and the fact that notes are described, it is +possible in optional position to increase legibility. When " # " letter +itself is described, like " the \# " treatment as notes by the fact that +" the \ " is put before the escape it is possible to do. With the +setting file, per 1 line as for the part which exceeds 1023 letters it +is ignored. + +7. Signal It is possible to make following kind of operation +cause, by sending the signal to the PROGRAM which is in the midst of +operating. + +SIGHUP Opening the setting file for the second time, it does + again to read setting. +SIGTERM It ends execution. + +SIGUSR1 Concerning the decive +where the Interface list first is appointed, regardless of +actual state it handles as those which the down are done. When the down +it does in the Up with this signal, the action at the time of the down +is executed mandatorily. In addition, this " forced down " state, until +the link down is really detected, when is kept (the down of the link is +really detected, returns to normal condition). Actually the link must +complete the down before doing, processing, the action (the unmount and +the like of the NFS volume) it is convenient to the case where it is. + +SIGUSR2 The same processing as the SIGUSR1 is done 2nd of the SIGUSR2 Interface +list vis-a-vis the device which is appointed to. + +8. Details of operation +PROGRAM first does the interpretation of the options, after that reads +the setting file. Setting of initial condition is done and, the +interface which is appointed concerning respectively. + +When the Debug mode or the dummy mode it is not appointed, (the daemon mode), by your +as it moves to background operation, the message from now on using the +facility and the priority which are appointed, reach the point where it +is outputted to the syslog. When the Debug mode and the dummy mode it is +appointed, it is outputted to standard error output as for the message +part (indication of the status) excluding. + +Furthermore, in order to output the PID file, when it is appointed, the output is done. Lastly, +setting of the handler for the necessary signal is done, preparation is +completed. + +It does the supervision of the Interface, in order vis-a-vis +the list which is appointed. When and, change of state is detected, +transitory the instability in order to remove, just the time when it is +appointed with the resense waits, reads out state once more. If state +agrees at this point in time, deciding state change, it moves to the +call of the action. When it does not agree, furthermore just time of the +resense waiting once more, it does again to acquire state. If it matches +a state where here it is acquired immediately before, that state is +decided, but if it does not agree even here, considering state of the +link is unstable, state change handles as those which are not detected. +Furthermore, when 0 is set to the resense, when state it does again to +read, does not do, state change detects it moves to the execution of the +action instantaneously. In addition, acquisition itself of state fails, +at the same time when " -a " the option is not appointed, the interface +is removed from the supervisory object list, does not do the detection +of from now on state. When the supervisory list becomes the sky, PROGRAM +ends. When it decides, that state has changed, the action which is +matched to that is executed. First the action description section for +the interface which detects change is searched from the forefront of the +setting file. Here, if the action cannot be discovered, without doing at +all, it moves to the processing of the following interface. + +At the time of the execution of the Action, acquisition of the IP addresses which +first the interface has is done. When the variable which shows the IP +address in the action (the $myaddr4/$myaddr6) it is, the action which +corresponds the address which the interface has vis-a-vis respectively, +is called over again. + +IP address variable is not included in the Action +when and, when -DWITHOUT_ADDR the compile it is done with attaching, the +call 1 time at a time is done vis-a-vis one action. IP address variable +being included, when the interface did not have the IP address of the +address family, the action is not executed. Execution of the Action is +done synchronously, until (execution of the command before ends, the +following command is not executed). Because of this, also the kind of +action which has an influence on execution sequence can execute safely. +On the other hand, when the kind of PROGRAM which does not end +permanently is appointed to the action, because all processing does the +block, note is necessary. When it finishes executing the consecutive +action, it moves to the processing of the following interface. When +processing completes vis-a-vis all interface which are appointed, equal +to the number of seconds which are appointed to the interval you wait, +in addition return to state detection in the first interface. As for +this operation, PROGRAM to receive the SIGTERM, or a some fatal obstacle +to occur, or until each condition whether the supervisory list to become +the sky, or be discontinued mandatorily from outside of, occurs, it is +repeated permanently. + +9. Thanks At the time of the development of this +PROGRAM, as the salt promontory 拓 it receives the idea and the advice +regarding improvement 也, you cooperated to the operation verification +in NetcBsd environment. In addition, it received the bug inside the +library and the information regarding operation the plum book 肇. Other +than operation verification with the FreecBsd, you participated in the +argument in the specification aspect in monkey circular Yoshihiko. The +Japanese man pages the tin it comes and densely - is the ち person +making. Borrowing this place, you appreciate in cooperation of everyone +one. + +10 Concerning the License This PROGRAM distributes, conforming to +the BSD-style license. Concerning redistribution, if it does not alter +or does not delete the indication and the license provision of the +literary work person, or, it makes free. In addition, the writer does +not owe all responsibility concerning the result of using this PROGRAM. +Please refer to the source code concerning the other provisions. + +11. Ahead communicating Please move aside opinion and operation report and +the bug report et cetera regarding this PROGRAM, below. Five counter +rice field fall the 彦 + +$Id: README and v 1.4 2002/06/12 14:41:57 a-gota Exp $