Debian Codegraph @

platform/freebsd/rsyslogd

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 # Sample startup script for rsyslogd on FreeBSD.
3 # It worked on my machine, but this does not necessarily
4 # mean it works on all machines - it's not thouroughly
5 # tested. Please note that it may also work on other
6 # BSD variants, too.
7 #
8 # As of this writing, there was an issue with the mysql client
9 # library on startup. If compiled with MySQL support, rsyslogd
10 # would not necessarily start correctly but could eventually
11 # die with a "mysql client libary not found" (or similar)
12 # message. I do not know its cause neither the cure. If you
13 # have one, let me know.
14 #
15 # ATTENTION: you need also to change the /etc/rc.config file
16 # and disable stock syslogd and then enable rsyslogd!
17 #
18 # rgerhards 2005-08-09 <[email protected]>
19 #
20
21 # PROVIDE: rsyslogd
22 # REQUIRE: mountcritremote cleanvar
23 # BEFORE: SERVERS
24
25 . /etc/rc.subrscip-shell source . . `/etc/rc.subr`.
26
27 name="rsyslogd"
28 rcvar=`set_rcvar`
29 pidfile="/var/run/rsyslogd.pidscip-shell filesystem . . `/var/run/rsyslogd.pid`."
30 command="/usr/sbin/${name}"
31 required_files="/etc/rsyslog.confscip-shell filesystem . . `/etc/rsyslog.conf`."
32 start_precmd="rsyslogd_precmd"
33 extra_commands="reload"
34
35 _sockfile="/var/run/rsyslogd.socketsscip-shell filesystem . . `/var/run/rsyslogd.sockets`."
36 evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\""
37 altlog_proglist="named"
38
39 rsyslogd_precmdscip-shell shell rsyslog 8.2604.0-4 rsyslogd_precmd().()
40 {
41 # Transitional symlink for old binaries
42 #
43 if [scip-shell system . . `[`. ! -L /dev/logscip-shell filesystem . . `/dev/log`. ]; then
44 lnscip-shell system . . ln. -sf /var/run/logscip-shell filesystem . . `/var/run/log`. /dev/logscip-shell filesystem . . `/dev/log`.
45 fi
46 rmscip-shell system . . rm. -f /var/run/logscip-shell filesystem . . `/var/run/log`.
47
48 # Create default list of syslog sockets to watch
49 #
50 ( umask 022 ; > $_sockfile )
51
52 # If running named(8) or ntpd(8) chrooted, added appropriate
53 # syslog socket to list of sockets to watch.
54 #
55 for _l in $altlog_proglist; do
56 eval _ldir=\$${_l}_chrootdir
57 if checkyesno `set_rcvar $_l` && [scip-shell system . . `[`. -n "$_ldir" ]; then
58 echoscip-shell system . . echo. "${_ldir}/var/run/log" >> $_sockfile
59 fi
60 done
61
62 # If other sockets have been provided, change run_rc_command()'s
63 # internal copy of $rsyslogd_flags to force use of specific
64 # rsyslogd sockets.
65 #
66 if [scip-shell system . . `[`. -s $_sockfile ]; then
67 echoscip-shell system . . echo. "/var/run/logscip-shell filesystem . . `/var/run/log`." >> $_sockfile
68 eval $evalargs
69 fi
70
71 return 0
72 }
73
74 set_socketlistscip-shell shell rsyslog 8.2604.0-4 set_socketlist().()
75 {
76 _socketargs=
77 for _s in `catscip-shell system . . cat. $_sockfile | trscip-shell system . . tr. '\n' ' '` ; do
78 _socketargs="-l $_s $_socketargs"
79 done
80 echoscip-shell system . . echo. $_socketargs
81 }
82 load_rc_config $name
83 run_rc_command "$1"