summaryrefslogtreecommitdiff
blob: 0cde618fa25f720efee6b2fb9f6a5665e7b0e2d7 (plain)
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
#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

COMMAND=/usr/bin/swift-init
PIDFILE=/var/run/swift/swift-container.pid

depend() {
    after net
}

checkconfig() {
    if [ ! -r /etc/swift/swift.conf ]; then
        eerror "Missing required config file: /etc/swift/swift.conf"
        return 1
    fi
    if [ ! -r /etc/swift/container-server.conf ]; then
        eerror "Missing required config file: /etc/swift/container-server.conf"
        return 1
    fi
    return 0
}

start() {
    checkconfig || return $?
    ebegin "Starting ${SVCNAME}"
    start-stop-daemon --start --quiet -i --pidfile ${PIDFILE} ${COMMAND} -- container start
    eend $?
}

stop() {
    ebegin "Stopping ${SVCNAME}"
    start-stop-daemon --stop --quiet -i --pidfile ${PIDFILE} ${COMMAND} -- container stop
    eend $?
}