~ubuntu-branches/ubuntu/vivid/sphinxsearch/vivid

« back to all changes in this revision

Viewing changes to debian/init.d

  • Committer: Package Import Robot
  • Author(s): Nicholas Bamber
  • Date: 2012-06-11 20:31:53 UTC
  • mfrom: (7.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120611203153-riiy1hm0i31njiyv
Tags: 2.0.4-1.1
* Non-maintainer upload.
* Removed hard-coded dependency on libmysqlclient16 (Closes: #676595)

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
    return 0
83
83
}
84
84
 
85
 
force_stop() {
 
85
do_force_stop() {
86
86
# Forcefully kill the process
87
87
    [ ! -f "$PIDFILE" ] && return
88
88
    if running ; then
101
101
    rm -f $PIDFILE
102
102
    return 0
103
103
}
104
 
 
105
 
case "$1" in
106
 
  start)
107
 
        echo -n "Starting $DESC: "
108
 
 
 
104
do_start() {
109
105
        # Check if we have the configuration file
110
106
        if [ ! -f /etc/sphinxsearch/sphinx.conf ]; then
111
107
            echo "\n"
112
108
            echo "Please create an /etc/sphinxsearch/sphinx.conf configuration file."
113
109
            echo "A template is provided as /etc/sphinxsearch/sphinx.conf.sample."
114
 
            exit 0
 
110
            exit 1
115
111
        fi
116
112
 
117
113
        start-stop-daemon --start --pidfile $PIDFILE --chuid sphinxsearch --exec ${DAEMON}
118
 
        [ -n "$STARTDELAY" ] && sleep $STARTDELAY
 
114
}
 
115
do_stop() {
 
116
        start-stop-daemon --stop --quiet --oknodo --user sphinxsearch --pidfile $PIDFILE \
 
117
            --exec $DAEMON
 
118
}
 
119
 
 
120
case "$1" in
 
121
  start)
 
122
        echo -n "Starting $DESC: "
 
123
        do_start
 
124
        [ -n "$STARTDELAY" ] && sleep $STARTDELAY
119
125
 
120
126
        if running ; then
121
127
            echo "$NAME."
125
131
        ;;
126
132
  stop)
127
133
        echo -n "Stopping $DESC: "
128
 
        start-stop-daemon --stop --quiet --oknodo --user sphinxsearch --pidfile $PIDFILE \
129
 
            --exec $DAEMON
 
134
        do_stop
130
135
        echo "$NAME."
131
136
        ;;
132
137
  force-stop)
133
138
        echo -n "Forcefully stopping $DESC: "
134
 
        force_stop
 
139
        do_force_stop
135
140
        if ! running ; then
136
141
            echo "$NAME."
137
142
        else
140
145
        ;;
141
146
  restart|reload|force-reload)
142
147
    echo -n "Restarting $DESC: "
143
 
        start-stop-daemon --stop --quiet --user sphinxsearch --oknodo --pidfile $PIDFILE \
144
 
            --exec $DAEMON
 
148
        do_stop
145
149
        [ -n "$DODTIME" ] && sleep $DODTIME
146
 
        start-stop-daemon --start --exec ${DAEMON}
 
150
        do_start
147
151
        echo "$NAME."
148
152
        ;;
149
153