Lines 1-40
Link Here
|
1 |
#!/bin/sh |
1 |
#!/sbin/runscript |
2 |
# |
2 |
# Copyright 1999-2006 Gentoo Foundation |
3 |
# Dr.Web (R) init script |
3 |
# Distributed under the terms of the GNU General Public License v2 |
4 |
# $Revision: 1.5 $ |
4 |
# $Header: $ |
5 |
# |
|
|
6 |
|
5 |
|
7 |
BIN="drwebd" |
6 |
PID=/var/drweb/run/drwebd.pid |
8 |
PROGRAM="/opt/drweb/$BIN" |
7 |
SCVNAME="DrWeb daemon" |
9 |
PIDFILE="/var/drweb/run/drwebd.pid" |
|
|
10 |
|
8 |
|
11 |
case "$1" in |
9 |
depend() { |
12 |
stop) |
10 |
need net |
13 |
echo -n "Shutting down Dr. Web daemon..." |
11 |
} |
14 |
if [ -f $PIDFILE ] ; then |
12 |
|
15 |
kill `head -1 $PIDFILE` |
13 |
start() { |
16 |
fi |
14 |
ebegin "Starting ${SVCNAME}" |
17 |
;; |
15 |
start-stop-daemon --quiet --start --pidfile ${PID} --exec /opt/drweb/drwebd |
18 |
reload) |
16 |
eend $? "Failed to start ${SVCNAME}" |
19 |
echo -n "Reloading Dr. Web daemon..." |
17 |
} |
20 |
if [ -f $PIDFILE ] ; then |
|
|
21 |
kill -HUP `head -1 $PIDFILE` |
22 |
fi |
23 |
;; |
24 |
restart) |
25 |
echo -n "Restarting Dr. Web daemon..." |
26 |
if [ -f $PIDFILE ] ; then |
27 |
kill `head -1 $PIDFILE` |
28 |
fi |
29 |
sleep 3 |
30 |
$PROGRAM |
31 |
;; |
32 |
start) |
33 |
echo -n "Starting Dr. Web daemon..." |
34 |
$PROGRAM |
35 |
;; |
36 |
*) |
37 |
echo $0: 'start|stop|restart|reload' |
38 |
;; |
39 |
esac |
40 |
|
18 |
|
41 |
-- etc/drweb/drweb-log 1970-01-01 01:00:00.000000000 +0100 |
19 |
stop() { |
|
|
20 |
ebegin "Stopping ${SVCNAME}" |
21 |
start-stop-daemon --quiet --stop --pidfile ${PID} |
22 |
eend $? "Failed to stop ${SVCNAME}" |
23 |
} |
24 |
|
25 |
reload() { |
26 |
ebegin "Reloading ${SVCNAME} ..." |
27 |
if [[ -f ${PID} ]] ; then |
28 |
kill -HUP `head -1 ${PID}` |
29 |
fi |
30 |
eend $? |
31 |
|
32 |
restart() { |
33 |
svc_stop |
34 |
sleep 2 |
35 |
svc_start |
36 |
} |
|
|
37 |
++ etc/drweb/drweb-log 2006-06-09 23:59:38.000000000 +0200 |
Line 0
Link Here
|
|
|
1 |
/var/log/drweb/*.log { |
2 |
rotate 4 |
3 |
monthly |
4 |
missingok |
5 |
notifempty |
6 |
compress |
7 |
postrotate |
8 |
/etc/init.d/syslog-ng reload > /dev/null 2>&1 || true |
9 |
/etc/init.d/drwebd restart > /dev/null 2>&1 || true |
10 |
endscript |
11 |
} |