Line 0
Link Here
|
|
|
1 |
#!/sbin/runscript |
2 |
|
3 |
depend() { |
4 |
need net |
5 |
# This won't cause a hard failure if neither is installed, however. |
6 |
use mysql |
7 |
use pgsql |
8 |
after mta |
9 |
} |
10 |
|
11 |
start() { |
12 |
ebegin "Performing dbmail checks" |
13 |
dbmail-util -a >/dev/null 2>&1 |
14 |
ret=$? |
15 |
if [ $ret -ne 0 ]; then |
16 |
eerror "There was a problem performing the dbmail checks" |
17 |
eerror "Run dbmail-util -a to determine the problem" |
18 |
return 1 |
19 |
fi |
20 |
|
21 |
if [ ! -f $DBMAIL_CONFIG ]; then |
22 |
eerror "configuration file $DBMAIL_CONFIG Not found" |
23 |
return 1 |
24 |
fi |
25 |
|
26 |
ebegin "Starting DBMail daemon ($DBMAIL_PROG)" |
27 |
start-stop-daemon --start --quiet \ |
28 |
--chuid $DBMAIL_USER \ |
29 |
--pidfile $DBMAIL_PIDFILE \ |
30 |
--exec $DBMAIL_EXEC \ |
31 |
--name $DBMAIL_PROG \ |
32 |
-- -f $DBMAIL_CONFIG -p $DBMAIL_PIDFILE $DBMAIL_OPTS 2>&1 |
33 |
eend $? |
34 |
} |
35 |
|
36 |
stop() { |
37 |
ebegin "Stopping DBMail daemon ($DBMAIL_PROG)" |
38 |
start-stop-daemon --stop --quiet --retry 5 \ |
39 |
--chuid $DBMAIL_USER \ |
40 |
--pidfile $DBMAIL_PIDFILE |
41 |
eend $? |
42 |
} |