1 1.1 lukem #!/bin/sh 2 1.1 lukem # 3 1.9 lukem # $NetBSD: syslogd,v 1.9 2002/01/18 10:48:41 lukem Exp $ 4 1.1 lukem # 5 1.1 lukem 6 1.1 lukem # PROVIDE: syslogd 7 1.7 lukem # REQUIRE: mountcritremote sysdb wscons 8 1.1 lukem 9 1.1 lukem . /etc/rc.subr 10 1.1 lukem 11 1.1 lukem name="syslogd" 12 1.7 lukem rcvar=$name 13 1.1 lukem command="/usr/sbin/${name}" 14 1.1 lukem pidfile="/var/run/${name}.pid" 15 1.1 lukem required_files="/etc/syslog.conf" 16 1.1 lukem start_precmd="syslogd_precmd" 17 1.2 lukem extra_commands="reload" 18 1.1 lukem 19 1.9 lukem _sockfile="/var/run/syslogd.sockets" 20 1.9 lukem 21 1.1 lukem syslogd_precmd() 22 1.1 lukem { 23 1.1 lukem # Transitional symlink for old binaries 24 1.1 lukem # 25 1.1 lukem if [ ! -h /dev/log ]; then 26 1.1 lukem ln -sf /var/run/log /dev/log 27 1.1 lukem fi 28 1.8 lukem 29 1.9 lukem # Create default list of syslog sockets to watch 30 1.9 lukem # 31 1.9 lukem ( umask 022 ; > $_sockfile ) 32 1.9 lukem 33 1.9 lukem # If running named(8) or ntpd(8) chrooted, added appropriate 34 1.9 lukem # syslog socket to list of sockets to watch. 35 1.9 lukem # 36 1.9 lukem for _l in named ntpd; do 37 1.9 lukem eval _ldir=\$${_l}_chrootdir 38 1.9 lukem if checkyesno $_l && [ -n "$_ldir" ]; then 39 1.9 lukem echo "${_ldir}/var/run/log" >> $_sockfile 40 1.9 lukem fi 41 1.9 lukem done 42 1.9 lukem 43 1.9 lukem # If other sockets have been provided, change run_rc_command()'s 44 1.9 lukem # internal copy of $syslogd_flags to force use of specific 45 1.9 lukem # syslogd sockets. 46 1.8 lukem # 47 1.9 lukem if [ -s $_sockfile ]; then 48 1.9 lukem echo "/var/run/log" >> $_sockfile 49 1.9 lukem _flags="-P $_sockfile" 50 1.8 lukem fi 51 1.8 lukem 52 1.1 lukem return 0 53 1.1 lukem } 54 1.1 lukem 55 1.3 lukem load_rc_config $name 56 1.2 lukem run_rc_command "$1" 57