libefivar: Remove unneeded WARNS setting (lib/Makefile.inc has it).
[dragonfly.git] / etc / rc.d / syslogd
blob17b3d75ec72978042f7e5c764e47bbb8ee2291de
1 #!/bin/sh
3 # $NetBSD: syslogd,v 1.12 2002/03/22 04:34:00 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/syslogd,v 1.4 2002/10/01 13:29:44 ru Exp $
7 # PROVIDE: syslogd
8 # REQUIRE: mountcritremote sysdb
9 # BEFORE: SERVERS
11 . /etc/rc.subr
13 name="syslogd"
14 rcvar=`set_rcvar`
15 command="/usr/sbin/${name}"
16 required_files="/etc/syslog.conf"
17 start_precmd="syslogd_precmd"
18 extra_commands="reload"
20 _sockfile="/var/run/syslogd.sockets"
22 pidfile="/var/run/syslog.pid"
23 evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\""
25 syslogd_precmd()
27 # Transitional symlink for old binaries
29 if [ ! -L /dev/log ]; then
30 ln -sf /var/run/log /dev/log
32 rm -f /var/run/log
34 # Create default list of syslog sockets to watch
36 ( umask 022 ; > $_sockfile )
38 # Find /etc/rc.d scripts with "chrootdir" rcorder(8) keyword,
39 # and if $${app}_chrootdir is a directory, add appropriate
40 # syslog socket to list of sockets to watch.
42 for _lr in $(rcorder -k chrootdir /etc/rc.d/*); do
44 _l=${_lr##*/}
45 load_rc_config ${_l}
46 eval _ldir=\$${_l}_chrootdir
47 if checkyesno $_l && [ -n "$_ldir" ]; then
48 echo "${_ldir}/var/run/log" >> $_sockfile
51 done
53 # If other sockets have been provided, change run_rc_command()'s
54 # internal copy of $syslogd_flags to force use of specific
55 # syslogd sockets.
57 if [ -s $_sockfile ]; then
58 echo "/var/run/log" >> $_sockfile
59 eval $evalargs
62 return 0
65 set_socketlist()
67 _socketargs=
68 for _s in `cat $_sockfile | tr '\n' ' '` ; do
69 _socketargs="-l $_s $_socketargs"
70 done
71 echo $_socketargs
73 load_rc_config $name
74 run_rc_command "$1"