]>
Commit | Line | Data |
---|---|---|
9c0defbc | 1 | #!/bin/sh |
2 | # | |
3 | # mnogosearch-stored This shell script takes care of starting and stopping | |
4 | # stored (optional part of mnogosearch engine) | |
5 | # | |
6 | # description: stored is a deamon which stores gziped version of parsed | |
7 | # documents (html pages, news atricles etc..) | |
8 | ||
9 | # Source function library | |
10 | . /etc/rc.d/init.d/functions | |
11 | ||
12 | # Get network config | |
13 | . /etc/sysconfig/network | |
14 | ||
15 | LOGFILE=/var/log/mnogosearch-stored | |
16 | ||
17 | # Get service config | |
18 | [ -f /etc/sysconfig/mnogosearch-stored ] && . /etc/sysconfig/mnogosearch-stored | |
19 | ||
20 | # Check that networking is up. | |
21 | if is_no "${NETWORKING}"; then | |
22 | msg_Network_Down Mnogosearch-stored | |
23 | exit 1 | |
24 | fi | |
25 | ||
26 | RETVAL=0 | |
27 | ||
28 | # See how we were called. | |
29 | case "$1" in | |
30 | start) | |
31 | # Check if the service is already running? | |
32 | if [ ! -f /var/lock/subsys/mnogosearch-stored ]; then | |
33 | ||
34 | # build aliases database | |
35 | ||
36 | msg_starting Mnogosearch-stored | |
37 | busy | |
38 | /usr/sbin/stored 2>&1 > $LOGFILE & | |
39 | sleep 1 | |
40 | ||
41 | if ps ax | grep -v grep | grep -q stored | |
42 | then | |
43 | deltext | |
44 | ok | |
45 | touch /var/lock/subsys/mnogosearch-stored | |
46 | else | |
47 | deltext | |
48 | fail | |
49 | RETVAL=1 | |
50 | fi | |
51 | else | |
52 | msg_Already_Running Mnogosearch-stored | |
53 | exit 1 | |
54 | fi | |
55 | ;; | |
56 | stop) | |
57 | # Stop daemons. | |
58 | msg_stopping Mnogosearch-stored | |
59 | killproc stored | |
60 | rm -f /var/lock/subsys/mnogosearch-stored | |
61 | ;; | |
62 | ;; | |
63 | restart|reload) | |
64 | $0 stop | |
65 | $0 start | |
66 | ;; | |
67 | status) | |
68 | status stored | |
69 | ;; | |
70 | *) | |
71 | msg_Usage "$0 {start|stop|status|restart|reload}" | |
72 | exit 1 | |
73 | esac | |
74 | ||
75 | exit $RETVAL |