-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.d.solaris
42 lines (39 loc) · 1.33 KB
/
init.d.solaris
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
#
# $Id: init.d.solaris,v 1.3 2003/04/11 13:37:47 bazsi Exp $
#
# adapted to syslog-ng by BJ, Aug, 7th 2000
# cleaned up by Bazsi, Oct, 12th 2000
# minor fix by Bojan Zdrnja, Apr, 11th 2003
# added nicer options field
#
DAEMON=/usr/local/sbin/syslog-ng
OPTIONS="-f /etc/syslog-ng/syslog-ng.conf"
case "$1" in
start)
if [ -f /etc/syslog-ng/syslog-ng.conf -a -f /usr/local/sbin/syslog-ng ]; then
echo 'syslog-ng service starting.'
#
# Before syslog-ng starts, save any messages from previous
# crash dumps so that messages appear in chronological order.
#
/usr/bin/savecore -m
if [ -r /etc/dumpadm.conf ]; then
. /etc/dumpadm.conf
[ "x$DUMPADM_DEVICE" != xswap ] && \
/usr/bin/savecore -m -f $DUMPADM_DEVICE
fi
$DAEMON $OPTIONS -p /etc/syslog-ng/syslog-ng.pid
fi
;;
stop)
if [ -f /etc/syslog-ng/syslog-ng.pid ]; then
syspid=`/usr/bin/cat /etc/syslog-ng/syslog-ng.pid`
[ "$syspid" -gt 0 ] && kill -15 $syspid && rm /etc/syslog-ng/syslog-ng.pid
fi
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac