]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man8/rc.subr.8
This commit was generated by cvs2svn to compensate for changes in r163976,
[FreeBSD/FreeBSD.git] / share / man / man8 / rc.subr.8
1 .\"     $NetBSD: rc.subr.8,v 1.12 2004/01/06 00:52:24 lukem Exp $
2 .\"
3 .\" Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Luke Mewburn.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\" 3. All advertising materials mentioning features or use of this software
18 .\"    must display the following acknowledgement:
19 .\"     This product includes software developed by the NetBSD
20 .\"     Foundation, Inc. and its contributors.
21 .\" 4. Neither the name of The NetBSD Foundation nor the names of its
22 .\"    contributors may be used to endorse or promote products derived
23 .\"    from this software without specific prior written permission.
24 .\"
25 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 .\" POSSIBILITY OF SUCH DAMAGE.
36 .\"
37 .\" $FreeBSD$
38 .\"
39 .Dd June 21, 2006
40 .Dt RC.SUBR 8
41 .Os
42 .Sh NAME
43 .Nm rc.subr
44 .Nd functions used by system shell scripts
45 .Sh SYNOPSIS
46 .Bl -item -compact
47 .It
48 .Ic .\& Pa /etc/rc.subr
49 .Pp
50 .It
51 .Ic backup_file Ar action Ar file Ar current Ar backup
52 .It
53 .Ic checkyesno Ar var
54 .It
55 .Ic check_pidfile Ar pidfile Ar procname Op Ar interpreter
56 .It
57 .Ic check_process Ar procname Op Ar interpreter
58 .It
59 .Ic debug Ar message
60 .It
61 .Ic err Ar exitval Ar message
62 .It
63 .Ic force_depend Ar name
64 .It
65 .Ic info Ar message
66 .It
67 .Ic load_kld Oo Fl e Ar regex Oc Oo Fl m Ar module Oc Ar file
68 .It
69 .Ic load_rc_config Ar name
70 .It
71 .Ic load_rc_config_var Ar name Ar var
72 .It
73 .Ic mount_critical_filesystems Ar type
74 .It
75 .Ic rc_usage Ar command ...
76 .It
77 .Ic reverse_list Ar item ...
78 .It
79 .Ic run_rc_command Ar argument
80 .It
81 .Ic run_rc_script Ar file Ar argument
82 .It
83 .Ic set_rcvar Op Ar base
84 .It
85 .Ic wait_for_pids Op Ar pid ...
86 .It
87 .Ic warn Ar message
88 .El
89 .Sh DESCRIPTION
90 The
91 .Nm
92 script
93 contains commonly used shell script functions and variable
94 definitions which are used by various scripts such as
95 .Xr rc 8 .
96 Scripts required by ports in
97 .Pa /usr/local/etc/rc.d
98 will also eventually
99 be rewritten to make use of it.
100 .Pp
101 The
102 .Nm
103 functions were mostly imported from
104 .Nx
105 and it is intended that they remain synced between the
106 two projects.
107 With that in mind there are several variable
108 definitions that can help in this regard.
109 They are:
110 .Bl -tag -width 4n
111 .It Va OSTYPE
112 Its value will be either
113 .Qq Li FreeBSD
114 or
115 .Qq Li NetBSD ,
116 depending on which OS it is running on.
117 .It Va SYSCTL
118 The path to the
119 .Xr sysctl 8
120 command.
121 .It Va SYSCTL_N
122 The path and argument list to display only the
123 .Xr sysctl 8
124 values instead of a
125 .Ar name Ns = Ns Ar value
126 pair.
127 .It Va SYSCTL_W
128 The path and argument to write or modify
129 .Xr sysctl 8
130 values.
131 .El
132 .Pp
133 The
134 .Nm
135 functions are accessed by sourcing
136 .Pa /etc/rc.subr
137 into the current shell.
138 .Pp
139 The following shell functions are available:
140 .Bl -tag -width 4n
141 .It Ic backup_file Ar action file current backup
142 Make a backup copy of
143 .Ar file
144 into
145 .Ar current .
146 If the
147 .Xr rc.conf 5
148 variable
149 .Va backup_uses_rcs
150 is
151 .Dq Li YES ,
152 use
153 .Xr rcs 1
154 to archive the previous version of
155 .Ar current ,
156 otherwise save the previous version of
157 .Ar current
158 as
159 .Ar backup .
160 .Pp
161 The
162 .Ar action
163 argument
164 may be one of the following:
165 .Bl -tag -width ".Cm remove"
166 .It Cm add
167 .Ar file
168 is now being backed up by or possibly re-entered into this backup mechanism.
169 .Ar current
170 is created, and if necessary, the
171 .Xr rcs 1
172 files are created as well.
173 .It Cm update
174 .Ar file
175 has changed and needs to be backed up.
176 If
177 .Ar current
178 exists, it is copied to
179 .Ar backup
180 or checked into
181 .Xr rcs 1
182 (if the repository file is old),
183 and then
184 .Ar file
185 is copied to
186 .Ar current .
187 .It Cm remove
188 .Ar file
189 is no longer being tracked by this backup mechanism.
190 If
191 .Xr rcs 1
192 is being used, an empty file is checked in and
193 .Ar current
194 is removed,
195 otherwise
196 .Ar current
197 is moved to
198 .Ar backup .
199 .El
200 .It Ic checkyesno Ar var
201 Return 0 if
202 .Ar var
203 is defined to
204 .Dq Li YES ,
205 .Dq Li TRUE ,
206 .Dq Li ON ,
207 or
208 .Ql 1 .
209 Return 1 if
210 .Ar var
211 is defined to
212 .Dq Li NO ,
213 .Dq Li FALSE ,
214 .Dq Li OFF ,
215 or
216 .Ql 0 .
217 Otherwise, warn that
218 .Ar var
219 is not set correctly.
220 The values are case insensitive.
221 .It Ic check_pidfile Ar pidfile procname Op Ar interpreter
222 Parses the first word of the first line of
223 .Ar pidfile
224 for a PID, and ensures that the process with that PID
225 is running and its first argument matches
226 .Ar procname .
227 Prints the matching PID if successful, otherwise nothing.
228 If
229 .Ar interpreter
230 is provided, parse the first line of
231 .Ar procname ,
232 ensure that the line is of the form:
233 .Pp
234 .Dl "#! interpreter [...]"
235 .Pp
236 and use
237 .Ar interpreter
238 with its optional arguments and
239 .Ar procname
240 appended as the process string to search for.
241 .It Ic check_process Ar procname Op Ar interpreter
242 Prints the PIDs of any processes that are running with a first
243 argument that matches
244 .Ar procname .
245 .Ar interpreter
246 is handled as per
247 .Ic check_pidfile .
248 .It Ic debug Ar message
249 Display a debugging message to
250 .Va stderr ,
251 log it to the system log using
252 .Xr logger 1 ,
253 and
254 return to the caller.
255 The error message consists of the script name
256 (from
257 .Va $0 ) ,
258 followed by
259 .Dq Li ": DEBUG: " ,
260 and then
261 .Ar message .
262 This function is intended to be used by developers
263 as an aid to debugging scripts.
264 It can be turned on or off
265 by the
266 .Xr rc.conf 5
267 variable
268 .Va rc_debug .
269 .It Ic err Ar exitval message
270 Display an error message to
271 .Va stderr ,
272 log it to the system log
273 using
274 .Xr logger 1 ,
275 and
276 .Ic exit
277 with an exit value of
278 .Ar exitval .
279 The error message consists of the script name
280 (from
281 .Va $0 ) ,
282 followed by
283 .Dq Li ": ERROR: " ,
284 and then
285 .Ar message .
286 .It Ic force_depend name
287 Output an advisory message and force the
288 .Ar name
289 service to start.
290 The
291 .Ar name
292 argument is the
293 .Xr basename 1
294 component of the path to the script, usually
295 .Pa /etc/rc.d/name .
296 If the script fails for any reason it will output a warning
297 and return with a return value of 1.
298 If it was successful
299 it will return 0.
300 .It Ic info Ar message
301 Display an informational message to
302 .Va stdout ,
303 and log it to the system log using
304 .Xr logger 1 .
305 The message consists of the script name
306 (from
307 .Va $0 ) ,
308 followed by
309 .Dq Li ": INFO: " ,
310 and then
311 .Ar message .
312 The display of this informational output can be
313 turned on or off by the
314 .Xr rc.conf 5
315 variable
316 .Va rc_info .
317 .It Ic load_kld Oo Fl e Ar regex Oc Oo Fl m Ar module Oc Ar file
318 Load
319 .Ar file
320 as a kernel module unless it is already loaded.
321 For the purpose of checking the module status,
322 either the exact module name can be specified using
323 .Fl m ,
324 or an
325 .Xr egrep 1
326 regular expression matching the module name can be supplied via
327 .Fl e .
328 By default, the module is assumed to have the same name as
329 .Ar file ,
330 which is not always the case.
331 .It Ic load_rc_config Ar name
332 Source in the configuration files for
333 .Ar name .
334 First,
335 .Pa /etc/rc.conf
336 is sourced if it has not yet been read in.
337 Then,
338 .Pa /etc/rc.conf.d/ Ns Ar name
339 is sourced if it is an existing file.
340 The latter may also contain other variable assignments to override
341 .Ic run_rc_command
342 arguments defined by the calling script, to provide an easy
343 mechanism for an administrator to override the behaviour of a given
344 .Xr rc.d 8
345 script without requiring the editing of that script.
346 .It Ic load_rc_config_var Ar name Ar var
347 Read the
348 .Xr rc.conf 5
349 variable
350 .Ar var
351 for
352 .Ar name
353 and set in the current shell, using
354 .Ic load_rc_config
355 in a sub-shell to prevent unwanted side effects from other variable
356 assignments.
357 .It Ic mount_critical_filesystems Ar type
358 Go through a list of critical file systems,
359 as found in the
360 .Xr rc.conf 5
361 variable
362 .Va critical_filesystems_ Ns Ar type ,
363 mounting each one that
364 is not currently mounted.
365 .It Ic rc_usage Ar command ...
366 Print a usage message for
367 .Va $0 ,
368 with
369 .Ar commands
370 being the list of valid arguments
371 prefixed by
372 .Sm off
373 .Dq Bq Li fast | force | one .
374 .Sm on
375 .It Ic reverse_list Ar item ...
376 Print the list of
377 .Ar items
378 in reverse order.
379 .It Ic run_rc_command Ar argument
380 Run the
381 .Ar argument
382 method for the current
383 .Xr rc.d 8
384 script, based on the settings of various shell variables.
385 .Ic run_rc_command
386 is extremely flexible, and allows fully functional
387 .Xr rc.d 8
388 scripts to be implemented in a small amount of shell code.
389 .Pp
390 .Ar argument
391 is searched for in the list of supported commands, which may be one
392 of:
393 .Bl -tag -width ".Cm restart" -offset indent
394 .It Cm start
395 Start the service.
396 This should check that the service is to be started as specified by
397 .Xr rc.conf 5 .
398 Also checks if the service is already running and refuses to start if
399 it is.
400 This latter check is not performed by standard
401 .Fx
402 scripts if the system is starting directly to multi-user mode, to
403 speed up the boot process.
404 .It Cm stop
405 If the service is to be started as specified by
406 .Xr rc.conf 5 ,
407 stop the service.
408 This should check that the service is running and complain if it is not.
409 .It Cm restart
410 Perform a
411 .Cm stop
412 then a
413 .Cm start .
414 Defaults to displaying the process ID of the program (if running).
415 .It Cm rcvar
416 Display which
417 .Xr rc.conf 5
418 variables are used to control the startup of the service (if any).
419 .El
420 .Pp
421 If
422 .Va pidfile
423 or
424 .Va procname
425 is set, also support:
426 .Bl -tag -width ".Cm restart" -offset indent
427 .It Cm poll
428 Wait for the command to exit.
429 .It Cm status
430 Show the status of the process.
431 .El
432 .Pp
433 Other supported commands are listed in the optional variable
434 .Va extra_commands .
435 .Pp
436 .Ar argument
437 may have one of the following prefixes which alters its operation:
438 .Bl -tag -width ".Li force" -offset indent
439 .It Li fast
440 Skip the check for an existing running process,
441 and sets
442 .Va rc_fast Ns = Ns Li YES .
443 .It Li force
444 Skip the checks for
445 .Va rcvar
446 being set to
447 .Dq Li YES ,
448 and sets
449 .Va rc_force Ns = Ns Li YES .
450 This ignores
451 .Ar argument Ns Va _precmd
452 returning non-zero, and ignores any of the
453 .Va required_*
454 tests failing, and always returns a zero exit status.
455 .It Li one
456 Skip the checks for
457 .Va rcvar
458 being set to
459 .Dq Li YES ,
460 but performs all the other prerequisite tests.
461 .El
462 .Pp
463 .Ic run_rc_command
464 uses the following shell variables to control its behaviour.
465 Unless otherwise stated, these are optional.
466 .Bl -tag -width ".Va procname" -offset indent
467 .It Va name
468 The name of this script.
469 This is not optional.
470 .It Va rcvar
471 The value of
472 .Va rcvar
473 is checked with
474 .Ic checkyesno
475 to determine if this method should be run.
476 .It Va command
477 Full path to the command.
478 Not required if
479 .Ar argument Ns Va _cmd
480 is defined for each supported keyword.
481 Can be overridden by
482 .Va ${name}_program .
483 .It Va command_args
484 Optional arguments and/or shell directives for
485 .Va command .
486 .It Va command_interpreter
487 .Va command
488 is started with:
489 .Pp
490 .Dl "#! command_interpreter [...]"
491 .Pp
492 which results in its
493 .Xr ps 1
494 command being:
495 .Pp
496 .Dl "command_interpreter [...] command"
497 .Pp
498 so use that string to find the PID(s) of the running command
499 rather than
500 .Va command .
501 .It Va extra_commands
502 Extra commands/keywords/arguments supported.
503 .It Va pidfile
504 Path to PID file.
505 Used to determine the PID(s) of the running command.
506 If
507 .Va pidfile
508 is set, use:
509 .Pp
510 .Dl "check_pidfile $pidfile $procname"
511 .Pp
512 to find the PID.
513 Otherwise, if
514 .Va command
515 is set, use:
516 .Pp
517 .Dl "check_process $procname"
518 .Pp
519 to find the PID.
520 .It Va procname
521 Process name to check for.
522 Defaults to the value of
523 .Va command .
524 .It Va required_dirs
525 Check for the existence of the listed directories
526 before running the default
527 .Cm start
528 method.
529 .It Va required_files
530 Check for the readability of the listed files
531 before running the default
532 .Cm start
533 method.
534 .It Va required_vars
535 Perform
536 .Ic checkyesno
537 on each of the list variables
538 before running the default
539 .Cm start
540 method.
541 .It Va ${name}_chdir
542 Directory to
543 .Ic cd
544 to before running
545 .Va command ,
546 if
547 .Va ${name}_chroot
548 is not provided.
549 .It Va ${name}_chroot
550 Directory to
551 .Xr chroot 8
552 to before running
553 .Va command .
554 Only supported after
555 .Pa /usr
556 is mounted.
557 .It Va ${name}_flags
558 Arguments to call
559 .Va command
560 with.
561 This is usually set in
562 .Xr rc.conf 5 ,
563 and not in the
564 .Xr rc.d 8
565 script.
566 The environment variable
567 .Sq Ev flags
568 can be used to override this.
569 .It Va ${name}_nice
570 .Xr nice 1
571 level to run
572 .Va command
573 as.
574 Only supported after
575 .Pa /usr
576 is mounted.
577 .It Va ${name}_program
578 Full path to the command.
579 Overrides
580 .Va command
581 if both are set, but has no effect if
582 .Va command
583 is unset.
584 As a rule,
585 .Va command
586 should be set in the script while
587 .Va ${name}_program
588 should be set in
589 .Xr rc.conf 5 .
590 .It Va ${name}_user
591 User to run
592 .Va command
593 as, using
594 .Xr chroot 8 .
595 if
596 .Va ${name}_chroot
597 is set, otherwise
598 uses
599 .Xr su 1 .
600 Only supported after
601 .Pa /usr
602 is mounted.
603 .It Va ${name}_group
604 Group to run the chrooted
605 .Va command
606 as.
607 .It Va ${name}_groups
608 Comma separated list of supplementary groups to run the chrooted
609 .Va command
610 with.
611 .It Ar argument Ns Va _cmd
612 Shell commands which override the default method for
613 .Ar argument .
614 .It Ar argument Ns Va _precmd
615 Shell commands to run just before running
616 .Ar argument Ns Va _cmd
617 or the default method for
618 .Ar argument .
619 If this returns a non-zero exit code, the main method is not performed.
620 If the default method is being executed, this check is performed after
621 the
622 .Va required_*
623 checks and process (non-)existence checks.
624 .It Ar argument Ns Va _postcmd
625 Shell commands to run if running
626 .Ar argument Ns Va _cmd
627 or the default method for
628 .Ar argument
629 returned a zero exit code.
630 .It Va sig_stop
631 Signal to send the processes to stop in the default
632 .Cm stop
633 method.
634 Defaults to
635 .Dv SIGTERM .
636 .It Va sig_reload
637 Signal to send the processes to reload in the default
638 .Cm reload
639 method.
640 Defaults to
641 .Dv SIGHUP .
642 .El
643 .Pp
644 For a given method
645 .Ar argument ,
646 if
647 .Ar argument Ns Va _cmd
648 is not defined, then a default method is provided by
649 .Ic run_rc_command :
650 .Bl -tag -width ".Sy Argument" -offset indent
651 .It Sy Argument
652 .Sy Default method
653 .It Cm start
654 If
655 .Va command
656 is not running and
657 .Ic checkyesno Va rcvar
658 succeeds, start
659 .Va command .
660 .It Cm stop
661 Determine the PIDs of
662 .Va command
663 with
664 .Ic check_pidfile
665 or
666 .Ic check_process
667 (as appropriate),
668 .Ic kill Va sig_stop
669 those PIDs, and run
670 .Ic wait_for_pids
671 on those PIDs.
672 .It Cm reload
673 Similar to
674 .Cm stop ,
675 except that it uses
676 .Va sig_reload
677 instead, and does not run
678 .Ic wait_for_pids .
679 Another difference from
680 .Cm stop
681 is that
682 .Cm reload
683 is not provided by default.
684 It can be enabled via
685 .Va extra_commands
686 if appropriate:
687 .Pp
688 .Dl "extra_commands=reload"
689 .It Cm restart
690 Runs the
691 .Cm stop
692 method, then the
693 .Cm start
694 method.
695 .It Cm status
696 Show the PID of
697 .Va command ,
698 or some other script specific status operation.
699 .It Cm poll
700 Wait for
701 .Va command
702 to exit.
703 .It Cm rcvar
704 Display which
705 .Xr rc.conf 5
706 variable is used (if any).
707 This method always works, even if the appropriate
708 .Xr rc.conf 5
709 variable is set to
710 .Dq Li NO .
711 .El
712 .Pp
713 The following variables are available to the methods
714 (such as
715 .Ar argument Ns Va _cmd )
716 as well as after
717 .Ic run_rc_command
718 has completed:
719 .Bl -tag -width ".Va rc_flags" -offset indent
720 .It Va rc_arg
721 Argument provided to
722 .Ic run_rc_command ,
723 after fast and force processing has been performed.
724 .It Va rc_flags
725 Flags to start the default command with.
726 Defaults to
727 .Va ${name}_flags ,
728 unless overridden by the environment variable
729 .Sq Ev flags .
730 This variable may be changed by the
731 .Ar argument Ns Va _precmd
732 method.
733 .It Va rc_pid
734 PID of
735 .Va command
736 (if appropriate).
737 .It Va rc_fast
738 Not empty if
739 .Dq Li fast
740 prefix was used.
741 .It Va rc_force
742 Not empty if
743 .Dq Li force
744 prefix was used.
745 .El
746 .It Ic run_rc_script Ar file argument
747 Start the script
748 .Ar file
749 with an argument of
750 .Ar argument ,
751 and handle the return value from the script.
752 .Pp
753 Various shell variables are unset before
754 .Ar file
755 is started:
756 .Bd -ragged -offset indent
757 .Va name ,
758 .Va command ,
759 .Va command_args ,
760 .Va command_interpreter ,
761 .Va extra_commands ,
762 .Va pidfile ,
763 .Va rcvar ,
764 .Va required_dirs ,
765 .Va required_files ,
766 .Va required_vars ,
767 .Ar argument Ns Va _cmd ,
768 .Ar argument Ns Va _precmd .
769 .Ar argument Ns Va _postcmd .
770 .Ed
771 .Pp
772 The startup behaviour of
773 .Ar file
774 depends upon the following checks:
775 .Bl -enum
776 .It
777 If
778 .Ar file
779 ends in
780 .Pa .sh ,
781 it is sourced into the current shell.
782 .It
783 If
784 .Ar file
785 appears to be a backup or scratch file
786 (e.g., with a suffix of
787 .Pa ~ , # , .OLD ,
788 or
789 .Pa .orig ) ,
790 ignore it.
791 .It
792 If
793 .Ar file
794 is not executable, ignore it.
795 .It
796 If the
797 .Xr rc.conf 5
798 variable
799 .Va rc_fast_and_loose
800 is empty,
801 source
802 .Ar file
803 in a sub shell,
804 otherwise source
805 .Ar file
806 into the current shell.
807 .El
808 .It Ic set_rcvar Op Ar base
809 Set the variable name required to start a service.
810 In
811 .Fx
812 a daemon is usually controlled by an
813 .Xr rc.conf 5
814 variable consisting of a daemon's name postfixed by the string
815 .Dq Li "_enable" .
816 This is not the case in
817 .Nx .
818 When the following line is included in a script:
819 .Pp
820 .Dl "rcvar=`set_rcvar`"
821 .Pp
822 this function will use the value of the
823 .Va $name
824 variable, which should be defined by the calling script,
825 to construct the appropriate
826 .Xr rc.conf 5
827 knob.
828 If the
829 .Ar base
830 argument is set it will use
831 .Ar base
832 instead of
833 .Va $name .
834 .It Ic wait_for_pids Op Ar pid ...
835 Wait until all of the provided
836 .Ar pids
837 do not exist any more, printing the list of outstanding
838 .Ar pids
839 every two seconds.
840 .It Ic warn Ar message
841 Display a warning message to
842 .Va stderr
843 and log it to the system log
844 using
845 .Xr logger 1 .
846 The warning message consists of the script name
847 (from
848 .Va $0 ) ,
849 followed by
850 .Dq Li ": WARNING: " ,
851 and then
852 .Ar message .
853 .El
854 .Sh FILES
855 .Bl -tag -width ".Pa /etc/rc.subr" -compact
856 .It Pa /etc/rc.subr
857 The
858 .Nm
859 file resides in
860 .Pa /etc .
861 .El
862 .Sh SEE ALSO
863 .Xr rc.conf 5 ,
864 .Xr rc 8
865 .Sh HISTORY
866 The
867 .Nm
868 script
869 appeared in
870 .Nx 1.3 .
871 The
872 .Xr rc.d 8
873 support functions appeared in
874 .Nx 1.5 .
875 The
876 .Nm
877 script
878 first appeared in
879 .Fx 5.0 .