source: hybrid/branches/releng-9.0/nanobsd/files/etc/rc.d/syslogd@ 10175

Last change on this file since 10175 was 10175, checked in by richardvm, 13 years ago

rename to more logical name

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/sh
2#
3# $FreeBSD: src/etc/rc.d/syslogd,v 1.13.2.1.6.1 2010/12/21 17:09:25 kensmith Exp $
4#
5
6# PROVIDE: syslogd
7# REQUIRE: mountcritremote cleanvar newsyslog
8# BEFORE: SERVERS
9
10. /etc/rc.subr
11name="syslogd"
12rcvar=`set_rcvar`
13pidfile="/var/run/syslog.pid"
14command="/usr/sbin/${name}"
15required_files="/etc/syslog.conf"
16start_precmd="syslogd_precmd"
17extra_commands="reload"
18sockfile="/var/run/syslogd.sockets"
19
20inf=$(dig +short `hostname`)
21command_args="-b $inf"
22
23evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\""
24altlog_proglist="named"
25
26syslogd_precmd()
27{
28 local _l _ldir
29
30 # Transitional symlink for old binaries
31 #
32 if [ ! -L /dev/log ]; then
33 ln -sf /var/run/log /dev/log
34 fi
35 rm -f /var/run/log
36
37 # Create default list of syslog sockets to watch
38 #
39 ( umask 022 ; > $sockfile )
40
41 # If running named(8) or ntpd(8) chrooted, added appropriate
42 # syslog socket to list of sockets to watch.
43 #
44 for _l in $altlog_proglist; do
45 eval _ldir=\$${_l}_chrootdir
46 if checkyesno `set_rcvar $_l` && [ -n "$_ldir" ]; then
47 echo "${_ldir}/var/run/log" >> $sockfile
48 fi
49 done
50
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.
54 #
55 if [ -s $sockfile ]; then
56 echo "/var/run/log" >> $sockfile
57 eval $evalargs
58 fi
59
60 return 0
61}
62
63set_socketlist()
64{
65 local _s _socketargs
66
67 _socketargs=
68 for _s in `cat $sockfile | tr '\n' ' '` ; do
69 _socketargs="-l $_s $_socketargs"
70 done
71 echo $_socketargs
72}
73load_rc_config $name
74run_rc_command "$1"
Note: See TracBrowser for help on using the repository browser.