Sync usage with man page.
[netbsd-mini2440.git] / etc / rc.d / syslogd
blob72a1c21376b76df4e5631f3b25ad7d3fa54f71b6
1 #!/bin/sh
3 # $NetBSD: syslogd,v 1.14 2004/08/13 18:08:03 mycroft Exp $
6 # PROVIDE: syslogd
7 # REQUIRE: mountcritremote sysdb wscons
8 # BEFORE: SERVERS
10 $_rc_subr_loaded . /etc/rc.subr
12 name="syslogd"
13 rcvar=$name
14 command="/usr/sbin/${name}"
15 pidfile="/var/run/${name}.pid"
16 required_files="/etc/syslog.conf"
17 start_precmd="syslogd_precmd"
18 extra_commands="reload"
20 _sockfile="/var/run/syslogd.sockets"
22 syslogd_precmd()
24 # Transitional symlink for old binaries
26 if [ ! -h /dev/log ]; then
27 ln -sf /var/run/log /dev/log
30 # Create default list of syslog sockets to watch
32 ( umask 022 ; > $_sockfile )
34 # Find /etc/rc.d scripts with "chrootdir" rcorder(8) keyword,
35 # and if $${app}_chrootdir is a directory, add appropriate
36 # syslog socket to list of sockets to watch.
38 for _lr in $(rcorder -k chrootdir /etc/rc.d/*); do
40 _l=${_lr##*/}
41 load_rc_config ${_l}
42 eval _ldir=\$${_l}_chrootdir
43 if checkyesno $_l && [ -n "$_ldir" ]; then
44 echo "${_ldir}/var/run/log" >> $_sockfile
47 done
49 # If other sockets have been provided, change run_rc_command()'s
50 # internal copy of $syslogd_flags to force use of specific
51 # syslogd sockets.
53 if [ -s $_sockfile ]; then
54 echo "/var/run/log" >> $_sockfile
55 rc_flags="-P $_sockfile $rc_flags"
58 return 0
61 load_rc_config $name
62 run_rc_command "$1"