File: init.d

package info (click to toggle)
sphinxsearch 2.2.11-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 25,720 kB
  • sloc: cpp: 102,259; xml: 85,608; sh: 9,259; php: 3,790; ansic: 3,158; yacc: 1,969; java: 1,336; ruby: 1,289; python: 1,062; pascal: 912; perl: 381; lex: 275; makefile: 150; sql: 77; cs: 35
file content (41 lines) | stat: -rw-r--r-- 1,302 bytes parent folder | download | duplicates (2)
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
#!/bin/sh /lib/init/init-d-script
### BEGIN INIT INFO
# Provides:          sphinxsearch
# Required-Start:    $local_fs $remote_fs $syslog $network $time
# Required-Stop:     $local_fs $remote_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Fast standalone full-text SQL search engine
### END INIT INFO

DAEMON=/usr/bin/searchd
NAME=sphinxsearch
PIDFILE=/run/sphinxsearch/searchd.pid

START_ARGS="--chuid sphinxsearch"
STOP_ARGS="--user sphinxsearch"

do_start_prepare() {
        if [ "$START" != "yes" ]; then
          echo "To enable $NAME, edit /etc/default/sphinxsearch and set START=yes"
          exit 0
        fi

        # Check if we have the configuration file
        if [ ! -f /etc/sphinxsearch/sphinx.conf ]; then
            echo "\n"
            echo "Please create an /etc/sphinxsearch/sphinx.conf configuration file."
            echo "A template is provided as /etc/sphinxsearch/sphinx.conf.sample."
            exit 1
        fi

        # Make sure the pidfile directory exists with correct permissions
        piddir=$(dirname "$PIDFILE")
        if [ ! -d "$piddir" ]; then
            mkdir -p "$piddir"
            chown -R sphinxsearch "$piddir"
            chgrp -R sphinxsearch "$piddir"
        fi
}

# vim: set syntax=sh: