openpkg/rc.8

changeset 779
8a3648cce554
parent 427
71503088f51b
equal deleted inserted replaced
1:cb879dddcde0 2:4a977f8acb31
1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 1 .\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.22)
2 .\" 2 .\"
3 .\" Standard preamble: 3 .\" Standard preamble:
4 .\" ======================================================================== 4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP) 5 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v 6 .if t .sp .5v
15 .if n .sp 7 .if n .sp
16 .. 8 ..
17 .de Vb \" Begin verbatim text 9 .de Vb \" Begin verbatim text
23 .ft R 15 .ft R
24 .fi 16 .fi
25 .. 17 ..
26 .\" Set up some character translations and predefined strings. \*(-- will 18 .\" Set up some character translations and predefined strings. \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left 19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote. | will give a 20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
29 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to 21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
30 .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' 22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
31 .\" expand to `' in nroff, nothing in troff, for use with C<>. 23 .\" nothing in troff, for use with C<>.
32 .tr \(*W-|\(bv\*(Tr 24 .tr \(*W-
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' 25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\ 26 .ie n \{\
35 . ds -- \(*W- 27 . ds -- \(*W-
36 . ds PI pi 28 . ds PI pi
37 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch 29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
46 . ds PI \(*p 38 . ds PI \(*p
47 . ds L" `` 39 . ds L" ``
48 . ds R" '' 40 . ds R" ''
49 'br\} 41 'br\}
50 .\" 42 .\"
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
44 .ie \n(.g .ds Aq \(aq
45 .el .ds Aq '
46 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for 47 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index 48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
53 .\" entries marked with X<> in POD. Of course, you'll have to process the 49 .\" entries marked with X<> in POD. Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion. 50 .\" output yourself in some meaningful fashion.
55 .if \nF \{\ 51 .ie \nF \{\
56 . de IX 52 . de IX
57 . tm Index:\\$1\t\\n%\t"\\$2" 53 . tm Index:\\$1\t\\n%\t"\\$2"
58 .. 54 ..
59 . nr % 0 55 . nr % 0
60 . rr F 56 . rr F
61 .\} 57 .\}
62 .\" 58 .el \{\
63 .\" For nroff, turn off justification. Always turn off hyphenation; it makes 59 . de IX
64 .\" way too many mistakes in technical documents. 60 ..
65 .hy 0 61 .\}
66 .if n .na
67 .\" 62 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). 63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear. Run. Save yourself. No user-serviceable parts. 64 .\" Fear. Run. Save yourself. No user-serviceable parts.
70 . \" fudge factors for nroff and troff 65 . \" fudge factors for nroff and troff
71 .if n \{\ 66 .if n \{\
128 .rm #[ #] #H #V #F C 123 .rm #[ #] #H #V #F C
129 .\" ======================================================================== 124 .\" ========================================================================
130 .\" 125 .\"
131 .IX Title "RC 8" 126 .IX Title "RC 8"
132 .TH RC 8 "OpenPKG" "RC(8)" "OpenPKG" 127 .TH RC 8 "OpenPKG" "RC(8)" "OpenPKG"
128 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
130 .if n .ad l
131 .nh
133 .SH "NAME" 132 .SH "NAME"
134 \&\fB@l_prefix@/bin/openpkg rc\fR \- OpenPKG Run\-Command Processor 133 @l_prefix@/bin/openpkg rc \- OpenPKG Run\-Command Processor
135 .SH "SYNOPSIS" 134 .SH "SYNOPSIS"
136 .IX Header "SYNOPSIS" 135 .IX Header "SYNOPSIS"
137 \&\fB@l_prefix@/bin/openpkg rc\fR [\fB\-s\fR|\fB\-\-silent\fR] [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-k\fR|\fB\-\-keep\fR] \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...] 136 \&\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR [\fB\-s\fR|\fB\-\-silent\fR] [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-k\fR|\fB\-\-keep\fR] [\fB\-D\fR|\fB\-\-define\fR \fIname\fR=\fIvalue\fR] \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]
138 .PP 137 .PP
139 \&\fB@l_prefix@/bin/openpkg rc\fR \fB\-p\fR|\fB\-\-print\fR \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...] 138 \&\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR \fB\-p\fR|\fB\-\-print\fR \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]
140 .PP 139 .PP
141 eval `\fB@l_prefix@/bin/openpkg rc\fR \fB\-e\fR|\fB\-\-eval\fR \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]` 140 eval `\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR \fB\-e\fR|\fB\-\-eval\fR \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]`
142 .PP 141 .PP
143 \&\fB@l_prefix@/bin/openpkg rc\fR \fB\-q\fR|\fB\-\-query\fR \fIvariable\fR [\fIvariable\fR ...] 142 \&\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR \fB\-q\fR|\fB\-\-query\fR \fIvariable\fR [\fIvariable\fR ...]
144 .PP 143 .PP
145 \&\fB@l_prefix@/bin/openpkg rc\fR \fB\-c\fR|\fB\-\-config\fR 144 \&\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR \fB\-c\fR|\fB\-\-config\fR
146 .PP 145 .PP
147 \&\fB@l_prefix@/bin/openpkg rc\fR \fB\-h\fR|\fB\-\-help\fR 146 \&\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR \fB\-h\fR|\fB\-\-help\fR
148 .SH "DESCRIPTION" 147 .SH "DESCRIPTION"
149 .IX Header "DESCRIPTION" 148 .IX Header "DESCRIPTION"
150 The \fB@l_prefix@/bin/openpkg rc\fR program is the run-command (rc) processor 149 The \fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR program is the run-command (rc) processor
151 of the \fBOpenPKG\fR instance \f(CW\*(C`@l_prefix@\*(C'\fR. It allows querying the rc 150 of the \fBOpenPKG\fR instance \f(CW\*(C`@l_prefix@\*(C'\fR. It allows querying the rc
152 configuration variables and the execution of rc command scripts of one 151 configuration variables and the execution of rc command scripts of one
153 or more installed \fBOpenPKG\fR packages. The implemented run-command 152 or more installed \fBOpenPKG\fR packages. The implemented run-command
154 facility is partly modeled after the classical \s-1UNIX\s0(tm) System V 153 facility is partly modeled after the classical \s-1UNIX\s0(tm) System V
155 run-command facility plus ideas taken from the FreeBSD and NetBSD 154 run-command facility plus ideas taken from the FreeBSD and NetBSD
156 run-command facilities. It mainly merges the classical startup/shutdown 155 run-command facilities. It mainly merges the classical startup/shutdown
157 procedures with periodical procedures into a single approach. 156 procedures with periodical procedures into a single approach.
158 .SH "USAGE" 157 .SH "USAGE"
159 .IX Header "USAGE" 158 .IX Header "USAGE"
160 .IP "\fB@l_prefix@/bin/openpkg rc\fR [\fB\-s\fR|\fB\-\-silent\fR] [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-k\fR|\fB\-\-keep\fR] \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]" 4 159 .ie n .IP "\fB\fB@l_prefix\fB@/bin/openpkg rc\fR [\fB\-s\fR|\fB\-\-silent\fR] [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-k\fR|\fB\-\-keep\fR] [\fB\-D\fR|\fB\-\-define\fR \fIname\fR=\fIvalue\fR] \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]" 4
161 .IX Item "@l_prefix@/bin/openpkg rc [-s|--silent] [-v|--verbose] [-d|--debug] [-k|--keep] package command [command ...]" 160 .el .IP "\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR [\fB\-s\fR|\fB\-\-silent\fR] [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-k\fR|\fB\-\-keep\fR] [\fB\-D\fR|\fB\-\-define\fR \fIname\fR=\fIvalue\fR] \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]" 4
162 \&\fBRuncommand Execution.\fR This executes one or more specified 161 .IX Item "@l_prefix@/bin/openpkg rc [-s|--silent] [-v|--verbose] [-d|--debug] [-k|--keep] [-D|--define name=value] package command [command ...]"
162 \&\fBRun-Command Execution.\fR This executes one or more specified
163 \&\fIcommand\fRs in a particular \fIpackage\fR or in all installed packages if 163 \&\fIcommand\fRs in a particular \fIpackage\fR or in all installed packages if
164 \&\fIpackage\fR is "\f(CW\*(C`all\*(C'\fR". Option \fB\-\-silent\fR can be used to explicitly 164 \&\fIpackage\fR is "\f(CW\*(C`all\*(C'\fR". Option \fB\-\-silent\fR can be used to explicitly
165 disable progress messages on \f(CW\*(C`stderr\*(C'\fR. Option \fB\-\-verbose\fR can be used 165 disable progress messages on \f(CW\*(C`stderr\*(C'\fR. Option \fB\-\-verbose\fR can be used
166 to explicitly enable progress messages on \f(CW\*(C`stderr\*(C'\fR. By default, \fBrc\fR 166 to explicitly enable progress messages on \f(CW\*(C`stderr\*(C'\fR. By default, \fBrc\fR
167 automatically determines whether progress messages should be displayed 167 automatically determines whether progress messages should be displayed
168 or not depending on whether \f(CW\*(C`stderr\*(C'\fR is connected to a terminal device. 168 or not depending on whether \f(CW\*(C`stderr\*(C'\fR is connected to a terminal device.
169 Option \fB\-\-keep\fR can be used for debugging purposes to keep the 169 Option \fB\-\-keep\fR can be used for debugging purposes to keep the
170 temporary files were generated during internal processing. 170 temporary files were generated during internal processing. Option
171 .IP "\fB@l_prefix@/bin/openpkg rc\fR \fB\-p\fR|\fB\-\-print\fR \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]" 4 171 \&\fB\-\-define\fR can be used to on-the-fly re-define a configuration variable
172 \&\fIname\fR with \fIvalue\fR.
173 .ie n .IP "\fB\fB@l_prefix\fB@/bin/openpkg rc\fR \fB\-p\fR|\fB\-\-print\fR \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]" 4
174 .el .IP "\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR \fB\-p\fR|\fB\-\-print\fR \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]" 4
172 .IX Item "@l_prefix@/bin/openpkg rc -p|--print package command [command ...]" 175 .IX Item "@l_prefix@/bin/openpkg rc -p|--print package command [command ...]"
173 \&\fBRuncommand Printing.\fR This is like the run-command execution (see 176 \&\fBRun-Command Printing.\fR This is like the run-command execution (see
174 above), but instead of immediately executing all involved individual 177 above), but instead of immediately executing all involved individual
175 run-command scripts, they are concatenated (but with all configuration 178 run-command scripts, they are concatenated (but with all configuration
176 parts reduced to a single configuration part) and printed to \f(CW\*(C`stdout\*(C'\fR. 179 parts reduced to a single configuration part) and printed to \f(CW\*(C`stdout\*(C'\fR.
177 Use this for debugging or post-processing purposes. 180 Use this for debugging or post-processing purposes.
178 .IP "eval `\fB@l_prefix@/bin/openpkg rc\fR \fB\-e\fR|\fB\-\-eval\fR \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]`" 4 181 .ie n .IP "eval `\fB\fB@l_prefix\fB@/bin/openpkg rc\fR \fB\-e\fR|\fB\-\-eval\fR \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]`" 4
182 .el .IP "eval `\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR \fB\-e\fR|\fB\-\-eval\fR \fIpackage\fR \fIcommand\fR [\fIcommand\fR ...]`" 4
179 .IX Item "eval `@l_prefix@/bin/openpkg rc -e|--eval package command [command ...]`" 183 .IX Item "eval `@l_prefix@/bin/openpkg rc -e|--eval package command [command ...]`"
180 \&\fBRuncommand Evaluation.\fR This is like the run-command execution 184 \&\fBRun-Command Evaluation.\fR This is like the run-command execution
181 (see above), but the resulting exported shell environment variables 185 (see above), but the resulting exported shell environment variables
182 are output to a temporary file as a (Bourne\-Shell or C\-Shell syntax) 186 are output to a temporary file as a (Bourne-Shell or C\-Shell syntax)
183 shell script, suitable for evaluation within the shell environment 187 shell script, suitable for evaluation within the shell environment
184 of the caller. A one-line script is printed to \f(CW\*(C`stdout\*(C'\fR which then 188 of the caller. A one-line script is printed to \f(CW\*(C`stdout\*(C'\fR which then
185 \&\*(L"sources\*(R" (and immediately removes) this temporary file. This is 189 \&\*(L"sources\*(R" (and immediately removes) this temporary file. This is
186 slightly different from printing the temporary script directly to 190 slightly different from printing the temporary script directly to
187 \&\f(CW\*(C`stdout\*(C'\fR, because not all shell implementations like to "\fBeval\fR\*(L" 191 \&\f(CW\*(C`stdout\*(C'\fR, because not all shell implementations like to "\fBeval\fR\*(L"
188 large multi-line scripts. Hence, use this for executing the \*(R"\f(CW\*(C`env\*(C'\fR" 192 large multi-line scripts. Hence, use this for executing the \*(R"\f(CW\*(C`env\*(C'\fR"
189 run-commands within the current shell. 193 run-commands within the current shell.
190 .IP "\fB@l_prefix@/bin/openpkg rc\fR \fB\-q\fR|\fB\-\-query\fR \fIvariable\fR [\fIvariable\fR ...]" 4 194 .ie n .IP "\fB\fB@l_prefix\fB@/bin/openpkg rc\fR \fB\-q\fR|\fB\-\-query\fR \fIvariable\fR [\fIvariable\fR ...]" 4
195 .el .IP "\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR \fB\-q\fR|\fB\-\-query\fR \fIvariable\fR [\fIvariable\fR ...]" 4
191 .IX Item "@l_prefix@/bin/openpkg rc -q|--query variable [variable ...]" 196 .IX Item "@l_prefix@/bin/openpkg rc -q|--query variable [variable ...]"
192 \&\fBConfiguration Variable Querying.\fR This queries the effective values 197 \&\fBConfiguration Variable Querying.\fR This queries the effective values
193 (see \fBRUN-COMMAND \s-1CONFIGURATION\s0\fR section below) of one or more 198 (see \fBRUN-COMMAND \s-1CONFIGURATION\s0\fR section below) of one or more
194 run-command configuration \fIvariable\fRs. Use this within a shell script 199 run-command configuration \fIvariable\fRs. Use this within a shell script
195 to selectively query a particular variable. 200 to selectively query a particular variable.
196 .IP "\fB@l_prefix@/bin/openpkg rc\fR \fB\-c\fR|\fB\-\-config\fR" 4 201 .ie n .IP "\fB\fB@l_prefix\fB@/bin/openpkg rc\fR \fB\-c\fR|\fB\-\-config\fR" 4
202 .el .IP "\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR \fB\-c\fR|\fB\-\-config\fR" 4
197 .IX Item "@l_prefix@/bin/openpkg rc -c|--config" 203 .IX Item "@l_prefix@/bin/openpkg rc -c|--config"
198 \&\fBConfiguration Variable Summary.\fR This displays on \f(CW\*(C`stdout\*(C'\fR a 204 \&\fBConfiguration Variable Summary.\fR This displays on \f(CW\*(C`stdout\*(C'\fR a
199 three-column table showing the name, default and effective values of 205 three-column table showing the name, default and effective values of
200 all run-command configuration variables. If \f(CW\*(C`stdout\*(C'\fR is connected to 206 all run-command configuration variables. If \f(CW\*(C`stdout\*(C'\fR is connected to
201 terminal device, variables where the default and effective values differ 207 terminal device, variables where the default and effective values differ
202 are shown in bold mode. 208 are shown in bold mode.
203 .IP "\fB@l_prefix@/bin/openpkg rc\fR \fB\-h\fR|\fB\-\-help\fR" 4 209 .ie n .IP "\fB\fB@l_prefix\fB@/bin/openpkg rc\fR \fB\-h\fR|\fB\-\-help\fR" 4
210 .el .IP "\fB\f(CB@l_prefix\fB@/bin/openpkg rc\fR \fB\-h\fR|\fB\-\-help\fR" 4
204 .IX Item "@l_prefix@/bin/openpkg rc -h|--help" 211 .IX Item "@l_prefix@/bin/openpkg rc -h|--help"
205 \&\fBRequesting Help.\fR This just displays a short summary of 212 \&\fBRequesting Help.\fR This just displays a short summary of
206 the usage for this program. 213 the usage for this program.
207 .SH "FILES" 214 .SH "FILES"
208 .IX Header "FILES" 215 .IX Header "FILES"
209 .ie n .Sh "RUN-COMMAND \s-1FILES\s0 (\*(C`@l_prefix@/bin/openpkg rc.d/rc.*\*(C')" 216 .ie n .SS "RUN-COMMAND \s-1FILES\s0 (\*(C`@l_prefix@/bin/openpkg rc.d/rc.*\*(C')"
210 .el .Sh "RUN-COMMAND \s-1FILES\s0 (\f(CW\*(C`@l_prefix@/bin/openpkg rc.d/rc.*\*(C'\fP)" 217 .el .SS "RUN-COMMAND \s-1FILES\s0 (\f(CW\*(C`@l_prefix@/bin/openpkg rc.d/rc.*\*(C'\fP)"
211 .IX Subsection "RUN-COMMAND FILES (@l_prefix@/bin/openpkg rc.d/rc.*)" 218 .IX Subsection "RUN-COMMAND FILES (@l_prefix@/bin/openpkg rc.d/rc.*)"
212 The foundation of the \fBOpenPKG\fR run-command facility are the individual 219 The foundation of the \fBOpenPKG\fR run-command facility are the individual
213 run-command files \f(CW\*(C`rc.*\*(C'\fR of the installed packages. They are all 220 run-command files \f(CW\*(C`rc.*\*(C'\fR of the installed packages. They are all
214 located in the directory \f(CW\*(C`@l_prefix@/bin/openpkg rc.d/\*(C'\fR and are named 221 located in the directory \f(CW\*(C`@l_prefix@/bin/openpkg rc.d/\*(C'\fR and are named
215 "\f(CW\*(C`rc.\*(C'\fR\fIpackage\fR\*(L". They consist of one or more sections, each starting 222 "\f(CW\*(C`rc.\*(C'\fR\fIpackage\fR\*(L". They consist of one or more sections, each starting
265 value, the intercepted messages are consolidated, reformatted with a 272 value, the intercepted messages are consolidated, reformatted with a
266 surrounding ASCII-art border and printed to \fIstderr\fR. If the section 273 surrounding ASCII-art border and printed to \fIstderr\fR. If the section
267 is tagged with option \fB\-o\fR, \fIstdout\fR messages are passed through 274 is tagged with option \fB\-o\fR, \fIstdout\fR messages are passed through
268 verbatim, even if the section script exists with a zero return value. 275 verbatim, even if the section script exists with a zero return value.
269 .RS 4 276 .RS 4
270 .ie n .IP "%start\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority]" 4 277 .ie n .IP "%start [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
271 .el .IP "\f(CW%start\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4 278 .el .IP "\f(CW%start\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
272 .IX Item "%start [-u user] [-p priority]" 279 .IX Item "%start [-u user] [-p priority]"
273 This section should start daemons or initialize components. 280 This section should start daemons or initialize components.
274 It is especially executed by \fBOpenPKG\fR during system startup. 281 It is especially executed by \fBOpenPKG\fR during system startup.
275 .ie n .IP "%stop\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority]" 4 282 .ie n .IP "%stop [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
276 .el .IP "\f(CW%stop\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4 283 .el .IP "\f(CW%stop\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
277 .IX Item "%stop [-u user] [-p priority]" 284 .IX Item "%stop [-u user] [-p priority]"
278 This section should stop daemons or cleaning up components. It is 285 This section should stop daemons or cleaning up components. It is
279 especially executed by \fBOpenPKG\fR during system shutdown and package 286 especially executed by \fBOpenPKG\fR during system shutdown and package
280 deinstallation. 287 deinstallation.
281 .ie n .IP "%restart\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority]" 4 288 .ie n .IP "%restart [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
282 .el .IP "\f(CW%restart\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4 289 .el .IP "\f(CW%restart\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
283 .IX Item "%restart [-u user] [-p priority]" 290 .IX Item "%restart [-u user] [-p priority]"
284 This section should restart daemons. 291 This section should restart daemons.
285 It is especially executed by \fBOpenPKG\fR during package upgrades. 292 It is especially executed by \fBOpenPKG\fR during package upgrades.
286 .ie n .IP "\*(C`%status \-o\*(C'\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority]" 4 293 .ie n .IP "\*(C`%status \-o\*(C' [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
287 .el .IP "\f(CW\*(C`%status \-o\*(C'\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4 294 .el .IP "\f(CW\*(C`%status \-o\*(C'\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
288 .IX Item "%status -o [-u user] [-p priority]" 295 .IX Item "%status -o [-u user] [-p priority]"
289 This section has to provide status information for a package 296 This section has to provide status information for a package
290 by printing to \f(CW\*(C`stdout\*(C'\fR (hence the \fB\-o\fR option is always required), 297 by printing to \f(CW\*(C`stdout\*(C'\fR (hence the \fB\-o\fR option is always required),
291 in Bourne-Shell syntax, the definition of three variables: 298 in Bourne-Shell syntax, the definition of three variables:
292 .RS 4 299 .RS 4
293 .ie n .IP "\fIpackage\fR\*(C`_enable\*(C'" 4 300 .ie n .IP "\fIpackage\fR\*(C`_enable\*(C'" 4
294 .el .IP "\fIpackage\fR\f(CW\*(C`_enable\*(C'\fR" 4 301 .el .IP "\fIpackage\fR\f(CW\*(C`_enable\*(C'\fR" 4
295 .IX Item "package_enable" 302 .IX Item "package_enable"
296 Whether package is enabled, i.e., whether it accepts run\-commands. This 303 Whether package is enabled, i.e., whether it accepts run-commands. This
297 variable just has to be printed, because is already set in current 304 variable just has to be printed, because is already set in current
298 script environment. 305 script environment.
299 .ie n .IP "\fIpackage\fR\*(C`_usable\*(C'" 4 306 .ie n .IP "\fIpackage\fR\*(C`_usable\*(C'" 4
300 .el .IP "\fIpackage\fR\f(CW\*(C`_usable\*(C'\fR" 4 307 .el .IP "\fIpackage\fR\f(CW\*(C`_usable\*(C'\fR" 4
301 .IX Item "package_usable" 308 .IX Item "package_usable"
307 Whether package is active, i.e., whether it is already running. 314 Whether package is active, i.e., whether it is already running.
308 This variable has to be individually determined. 315 This variable has to be individually determined.
309 .RE 316 .RE
310 .RS 4 317 .RS 4
311 .RE 318 .RE
312 .ie n .IP "%monthly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority]" 4 319 .ie n .IP "%monthly [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
313 .el .IP "\f(CW%monthly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4 320 .el .IP "\f(CW%monthly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
314 .IX Item "%monthly [-u user] [-p priority]" 321 .IX Item "%monthly [-u user] [-p priority]"
315 .PD 0 322 .PD 0
316 .ie n .IP "%weekly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority]" 4 323 .ie n .IP "%weekly [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
317 .el .IP "\f(CW%weekly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4 324 .el .IP "\f(CW%weekly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
318 .IX Item "%weekly [-u user] [-p priority]" 325 .IX Item "%weekly [-u user] [-p priority]"
319 .ie n .IP "%hourly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority]" 4 326 .ie n .IP "%hourly [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
320 .el .IP "\f(CW%hourly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4 327 .el .IP "\f(CW%hourly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
321 .IX Item "%hourly [-u user] [-p priority]" 328 .IX Item "%hourly [-u user] [-p priority]"
322 .ie n .IP "%quarterly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority]" 4 329 .ie n .IP "%quarterly [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
323 .el .IP "\f(CW%quarterly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4 330 .el .IP "\f(CW%quarterly\fR [\fB\-u\fR \fIuser\fR] [\fB\-p\fR \fIpriority\fR]" 4
324 .IX Item "%quarterly [-u user] [-p priority]" 331 .IX Item "%quarterly [-u user] [-p priority]"
325 .PD 332 .PD
326 These sections should perform periodical tasks for a package and 333 These sections should perform periodical tasks for a package and
327 are executed on a monthly, weekly, hourly or quarterly basis. 334 are executed on a monthly, weekly, hourly or quarterly basis.
338 .IX Item "Custom Sections" 345 .IX Item "Custom Sections"
339 All other sections are custom ones and can be fully individual to each 346 All other sections are custom ones and can be fully individual to each
340 package. Some often seen sections are \f(CW%reload\fR (just reload the 347 package. Some often seen sections are \f(CW%reload\fR (just reload the
341 configuration without full stop and start procedure), \f(CW%info\fR (output 348 configuration without full stop and start procedure), \f(CW%info\fR (output
342 arbitrary information about package), etc. 349 arbitrary information about package), etc.
343 .ie n .Sh "RUN-COMMAND \s-1CONFIGURATION\s0 (\*(C`@l_prefix@/bin/openpkg rc.conf\*(C')" 350 .ie n .SS "RUN-COMMAND \s-1CONFIGURATION\s0 (\*(C`@l_prefix@/bin/openpkg rc.conf\*(C')"
344 .el .Sh "RUN-COMMAND \s-1CONFIGURATION\s0 (\f(CW\*(C`@l_prefix@/bin/openpkg rc.conf\*(C'\fP)" 351 .el .SS "RUN-COMMAND \s-1CONFIGURATION\s0 (\f(CW\*(C`@l_prefix@/bin/openpkg rc.conf\*(C'\fP)"
345 .IX Subsection "RUN-COMMAND CONFIGURATION (@l_prefix@/bin/openpkg rc.conf)" 352 .IX Subsection "RUN-COMMAND CONFIGURATION (@l_prefix@/bin/openpkg rc.conf)"
346 The run-command configuration variables defined in the "\f(CW%config\fR" 353 The run-command configuration variables defined in the "\f(CW%config\fR"
347 sections of all installed packages can be overridden by the 354 sections of all installed packages can be overridden by the
348 administrator in the global file \f(CW\*(C`@l_prefix@/bin/openpkg rc.conf\*(C'\fR. This file is 355 administrator in the global file \f(CW\*(C`@l_prefix@/bin/openpkg rc.conf\*(C'\fR. This file is
349 usually empty, but can be filled with Bourne-Shell compatible variable 356 usually empty, but can be filled with Bourne-Shell compatible variable
350 assignment statements like "\fIpackage\fR\f(CW\*(C`_\*(C'\fR\fIvariable\fR=\fIvalue\fR". 357 assignment statements like "\fIpackage\fR\f(CW\*(C`_\*(C'\fR\fIvariable\fR=\fIvalue\fR".
351 .ie n .Sh "RUN-COMMAND \s-1FUNCTIONS\s0 (\*(C`@l_prefix@/bin/openpkg rc.func\*(C')" 358 .ie n .SS "RUN-COMMAND \s-1FUNCTIONS\s0 (\*(C`@l_prefix@/bin/openpkg rc.func\*(C')"
352 .el .Sh "RUN-COMMAND \s-1FUNCTIONS\s0 (\f(CW\*(C`@l_prefix@/bin/openpkg rc.func\*(C'\fP)" 359 .el .SS "RUN-COMMAND \s-1FUNCTIONS\s0 (\f(CW\*(C`@l_prefix@/bin/openpkg rc.func\*(C'\fP)"
353 .IX Subsection "RUN-COMMAND FUNCTIONS (@l_prefix@/bin/openpkg rc.func)" 360 .IX Subsection "RUN-COMMAND FUNCTIONS (@l_prefix@/bin/openpkg rc.func)"
354 The file \f(CW\*(C`@l_prefix@/bin/openpkg rc.func\*(C'\fR is prepended to the scripts of all 361 The file \f(CW\*(C`@l_prefix@/bin/openpkg rc.func\*(C'\fR is prepended to the scripts of all
355 executed run-command sections and provides reusable functions. 362 executed run-command sections and provides reusable functions.
356 Currently the following functions are defined: 363 Currently the following functions are defined:
357 .IP "\fBrcMsg\fR [\fB\-e\fR] [\fB\-w\fR] \fImessage\fR" 4 364 .IP "\fBrcMsg\fR [\fB\-e\fR] [\fB\-w\fR] \fImessage\fR" 4
404 \& foo_log_prolog="true" 411 \& foo_log_prolog="true"
405 \& foo_log_epilog="true" 412 \& foo_log_epilog="true"
406 \& foo_log_numfiles="10" 413 \& foo_log_numfiles="10"
407 \& foo_log_minsize="1M" 414 \& foo_log_minsize="1M"
408 \& foo_log_complevel="9" 415 \& foo_log_complevel="9"
409 .Ve 416 \&
410 .PP
411 .Vb 13
412 \& %common 417 \& %common
413 \& foo_homedir="@l_prefix@/share/foo" 418 \& foo_homedir="@l_prefix@/share/foo"
414 \& foo_cfgfile="@l_prefix@/etc/foo/foo.cfg" 419 \& foo_cfgfile="@l_prefix@/etc/foo/foo.cfg"
415 \& foo_pidfile="@l_prefix@/var/foo/foo.pid" 420 \& foo_pidfile="@l_prefix@/var/foo/foo.pid"
416 \& foo_logfile="@l_prefix@/var/foo/foo.log" 421 \& foo_logfile="@l_prefix@/var/foo/foo.log"
417 \& foo_signal () { 422 \& foo_signal () {
418 \& if [ -f ${foo_pidfile} ]; then 423 \& if [ \-f ${foo_pidfile} ]; then
419 \& kill -$1 `cat ${foo_pidfile}` 424 \& kill \-$1 \`cat ${foo_pidfile}\`
420 \& return $? 425 \& return $?
421 \& else 426 \& else
422 \& return 1 427 \& return 1
423 \& fi 428 \& fi
424 \& } 429 \& }
425 .Ve 430 \&
426 .PP
427 .Vb 15
428 \& %status 431 \& %status
429 \& foo_usable="no" 432 \& foo_usable="no"
430 \& if [ ".`grep '<<PASSWORD>>' ${foo_cfgfile}`" = . ]; then 433 \& if [ ".\`grep \*(Aq<<PASSWORD>>\*(Aq ${foo_cfgfile}\`" = . ]; then
431 \& foo_usable="yes" 434 \& foo_usable="yes"
432 \& fi 435 \& fi
433 \& foo_active="no" 436 \& foo_active="no"
434 \& if [ -f ${foo_pidfile} ]; then 437 \& if [ \-f ${foo_pidfile} ]; then
435 \& foo_signal 0 438 \& foo_signal 0
436 \& if [ $? -eq 0 ]; then 439 \& if [ $? \-eq 0 ]; then
437 \& foo_active="yes" 440 \& foo_active="yes"
438 \& fi 441 \& fi
439 \& fi 442 \& fi
440 \& echo "foo_enable=${foo_enable}" 443 \& echo "foo_enable=${foo_enable}"
441 \& echo "foo_usable=${foo_usable}" 444 \& echo "foo_usable=${foo_usable}"
442 \& echo "foo_active=${foo_active}" 445 \& echo "foo_active=${foo_active}"
443 .Ve 446 \&
444 .PP
445 .Vb 4
446 \& %start 447 \& %start
447 \& rcService foo enable yes || exit 0 448 \& rcService foo enable yes || exit 0
448 \& rcService foo active yes && exit 0 449 \& rcService foo active yes && exit 0
449 \& @l_prefix@/sbin/foo --listen ${foo_listen} 450 \& @l_prefix@/sbin/foo \-\-listen ${foo_listen}
450 .Ve 451 \&
451 .PP
452 .Vb 4
453 \& %stop 452 \& %stop
454 \& rcService foo enable yes || exit 0 453 \& rcService foo enable yes || exit 0
455 \& rcService foo active yes || exit 0 454 \& rcService foo active yes || exit 0
456 \& foo_signal TERM 455 \& foo_signal TERM
457 .Ve 456 \&
458 .PP
459 .Vb 4
460 \& %restart 457 \& %restart
461 \& rcService foo enable yes || exit 0 458 \& rcService foo enable yes || exit 0
462 \& rcService foo active yes || exit 0 459 \& rcService foo active yes || exit 0
463 \& rc foo stop start 460 \& rc foo stop start
464 .Ve 461 \&
465 .PP
466 .Vb 7
467 \& %daily 462 \& %daily
468 \& rcService foo enable yes || exit 0 463 \& rcService foo enable yes || exit 0
469 \& shtool rotate -f \e 464 \& shtool rotate \-f \e
470 \& -n ${foo_log_numfiles} -s ${foo_log_minsize} -d \e 465 \& \-n ${foo_log_numfiles} \-s ${foo_log_minsize} \-d \e
471 \& -z ${foo_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \e 466 \& \-z ${foo_log_complevel} \-o @l_rusr@ \-g @l_rgrp@ \-m 644 \e
472 \& -P "${foo_log_prolog}" -E "${foo_log_epilog}" \e 467 \& \-P "${foo_log_prolog}" \-E "${foo_log_epilog}" \e
473 \& ${foo_logfile} 468 \& ${foo_logfile}
474 .Ve 469 \&
475 .PP
476 .Vb 5
477 \& %env 470 \& %env
478 \& if rcService foo enable yes; then 471 \& if rcService foo enable yes; then
479 \& FOO_HOME="$foo_homedir" 472 \& FOO_HOME="$foo_homedir"
480 \& export FOO_HOME 473 \& export FOO_HOME
481 \& fi 474 \& fi
483 .PP 476 .PP
484 Now, show all run-command configuration variables, their 477 Now, show all run-command configuration variables, their
485 default values and their effective values of package "\f(CW\*(C`foo\*(C'\fR": 478 default values and their effective values of package "\f(CW\*(C`foo\*(C'\fR":
486 .PP 479 .PP
487 .Vb 1 480 .Vb 1
488 \& $ @l_prefix@/bin/openpkg rc --config | grep "^foo_" 481 \& $ @l_prefix@/bin/openpkg rc \-\-config | grep "^foo_"
489 .Ve 482 .Ve
490 .PP 483 .PP
491 Override the default value of a run-command configuration 484 Override the default value of a run-command configuration
492 variable \f(CW\*(C`foo_listen\*(C'\fR: 485 variable \f(CW\*(C`foo_listen\*(C'\fR:
493 .PP 486 .PP
494 .Vb 1 487 .Vb 1
495 \& $ echo 'foo_listen="192.168.0.1"' >>@l_prefix@/bin/openpkg rc.conf 488 \& $ echo \*(Aqfoo_listen="192.168.0.1"\*(Aq >>@l_prefix@/bin/openpkg rc.conf
496 .Ve 489 .Ve
497 .PP 490 .PP
498 Stop and start from scratch the package "\f(CW\*(C`foo\*(C'\fR": 491 Stop and start from scratch the package "\f(CW\*(C`foo\*(C'\fR":
499 .PP 492 .PP
500 .Vb 1 493 .Vb 1
503 .PP 496 .PP
504 Query the effective value of run-command configuration 497 Query the effective value of run-command configuration
505 variable \f(CW\*(C`foo_enable\*(C'\fR in a script: 498 variable \f(CW\*(C`foo_enable\*(C'\fR in a script:
506 .PP 499 .PP
507 .Vb 1 500 .Vb 1
508 \& if [ ".`@l_prefix@/bin/openpkg rc -q foo_enable`" = .yes ]; then ... 501 \& if [ ".\`@l_prefix@/bin/openpkg rc \-q foo_enable\`" = .yes ]; then ...
509 .Ve 502 .Ve
510 .PP 503 .PP
511 Import all environment settings from all (including "\f(CW\*(C`foo\*(C'\fR") installed 504 Import all environment settings from all (including "\f(CW\*(C`foo\*(C'\fR") installed
512 packages into the current Bourne-Shell environment: 505 packages into the current Bourne-Shell environment:
513 .PP 506 .PP
514 .Vb 2 507 .Vb 2
515 \& $ eval `@l_prefix@/bin/openpkg rc --eval all env` 508 \& $ eval \`@l_prefix@/bin/openpkg rc \-\-eval all env\`
516 \& $ echo $FOO_HOME 509 \& $ echo $FOO_HOME
517 .Ve 510 .Ve
518 .SH "SEE ALSO" 511 .SH "SEE ALSO"
519 .IX Header "SEE ALSO" 512 .IX Header "SEE ALSO"
520 \&\fBOpenPKG\fR http://www.openpkg.org/ 513 \&\fBOpenPKG\fR http://www.openpkg.org/

mercurial