etc/services - sync with NetBSD-8
[minix.git] / etc / rc.d / syslogd
blobb467acac961649b28f15f293fa24069490603eb2
1 #!/bin/sh
3 # $NetBSD: syslogd,v 1.15 2004/10/11 13:29:52 lukem 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 # MINIX 3: unsupported, disabled
27 #if [ ! -h /dev/log ]; then
28 # ln -sf /var/run/log /dev/log
29 #fi
30 # MINIX 3: end
32 # Create default list of syslog sockets to watch
34 ( umask 022 ; > $_sockfile )
36 # Find /etc/rc.d scripts with "chrootdir" rcorder(8) keyword,
37 # and if $${app}_chrootdir is a directory, add appropriate
38 # syslog socket to list of sockets to watch.
40 for _lr in $(rcorder -k chrootdir /etc/rc.d/*); do
42 _l=${_lr##*/}
43 load_rc_config ${_l}
44 eval _ldir=\$${_l}_chrootdir
45 if checkyesno $_l && [ -n "$_ldir" ]; then
46 echo "${_ldir}/var/run/log" >> $_sockfile
49 done
51 # If other sockets have been provided, change run_rc_command()'s
52 # internal copy of $syslogd_flags to force use of specific
53 # syslogd sockets.
55 if [ -s $_sockfile ]; then
56 echo "/var/run/log" >> $_sockfile
57 rc_flags="-P $_sockfile $rc_flags"
60 return 0
63 load_rc_config $name
64 run_rc_command "$1"