Index: ossp-pkg/rc/rc.pod RCS File: /v/ossp/cvs/ossp-pkg/rc/rc.pod,v rcsdiff -q -kk '-r1.32' '-r1.33' -u '/v/ossp/cvs/ossp-pkg/rc/rc.pod,v' 2>/dev/null --- rc.pod 2003/06/23 11:29:44 1.32 +++ rc.pod 2003/06/23 14:43:48 1.33 @@ -112,7 +112,7 @@ =item B<-c>|B<--conf> I[C<:>I[...]] specify the location of the configuration file. If omitted, C<$OSSP_RC_CONF> -will be examined. If absent, F<@l_prefix@/etc/rc.conf> will be used. If no +will be examined. If absent, F will be used. If no F exists at all, then only command line and environment specified options will override the defaults built-in to OSSP rc. @@ -286,16 +286,30 @@ =head1 EXAMPLES -A runcommand consists of a single program name and one or more sections. The -wildcard 'all' can be given in place of a program name to denote all programs -with entries in the rc registry F<$OSSP_RC_ROOT/rc.d>. The following are -one-line examples of commonly used rc commands with no arguments. +The following are one-line examples of commonly used rc commands with no +arguments. Because no run mode option is specified, B will process +the commands by executing them directly. /usr/local/bin/rc --info /sbin/rc --query lmtp2nntp + /usr/local/bin/rc httpd reload /cw/etc/rc --conf /etc/rc.conf --debug smtpd stop - /sfw/etc/rc.d/rc.ntpd --silent start sync stop start - /usr/local/bin/rc httpd reload # sends a HUP signal + /opt/bin/rc ntpd --silent start sync stop start + +B offers more than just command execution. In the following examples +because the 'eval' run mode option is specified, B will prepare the +commands by writing a composite script to a tempfile. Then B will +print the file's location in a format most conveniently parsable by eval(1) or +the bourne shell for evaluation. + + eval `/usr/local/bin/rc --eval all env` + /usr/local/bin/rc --eval sendmail start | sh + +To read the results of a B operation without executing or evaluting +the runcommands, use the 'print' run mode. + + /opt/binbin/rc --print --info mico + /usr/local/bin/rc --print httpd reload Arguments in the form of name=value pairs may be passed to the section(s) given on the command line. In the F, such arguments will appear as @@ -311,14 +325,6 @@ /cw/etc/rc.d/rc.ftpd start nMax=32 # a maximum of 32 users can connect rc -rdv all stop nSleep=2 start nSleep=4 sLevel="LOG_INFO" bQuiet=1 -To evaluate a runcommand for all programs with an identical section name, a -short expression can be written into a F<.profile> file. When the shell -initializes itself, the runcommands will execute according to the C -command. This is often seen when importing the environment of packages of an -B hierarchy, but is always a custom modification made by the user. - - $ eval `@l_prefix@/etc/rc --eval all env` - =head1 FILES F - Master configuration file @@ -345,8 +351,8 @@ B is a drop-in replacement for the prototype run-command facility used in OpenPKG (http://www.openpkg.org/). The prototype was a slow and less robust Bourne shell script. B is comparitively faster, more robust, and more -flexible. This flexibility allows for wider range of use, and B can -therefore be used in a larger variety of situations. It is no longer exclusive -to the OpenPKG project. +feature rich. Its generic design and improved flexibility allows for wider +range of use, and B can therefore be used in a larger variety of +situations. Today, B is not exclusive to the OpenPKG project. =cut Index: ossp-pkg/rc/rc_const.h RCS File: /v/ossp/cvs/ossp-pkg/rc/rc_const.h,v rcsdiff -q -kk '-r1.26' '-r1.27' -u '/v/ossp/cvs/ossp-pkg/rc/rc_const.h,v' 2>/dev/null --- rc_const.h 2003/06/23 11:27:54 1.26 +++ rc_const.h 2003/06/23 14:43:48 1.27 @@ -32,7 +32,7 @@ /* Generic text, should include newline termination */ #define RC_NON_TEXT "No options exist.\n" -#define RC_LST_TEXT "Please enter just one rcfile and at least one section.\n" +#define RC_LST_TEXT "Please enter just one rcfile name and at least one section label.\n" #define RC_EEP_TEXT "The exec, eval, and print options may not be combined.\n" #define RC_SLO_TEXT "The silent option may not be combined with output options.\n" #define RC_SUM_TEXT "Option argument summary.\n"