Lines 1-56
Link Here
|
1 |
#!/sbin/runscript |
1 |
#!/sbin/runscript |
2 |
# Copyright 1999-2013 Gentoo Foundation |
2 |
# Copyright 1999-2014 Gentoo Foundation |
3 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# Distributed under the terms of the GNU General Public License v2 |
4 |
# $Header: /var/cvsroot/gentoo-x86/sys-auth/keystone/files/keystone.initd,v 1.3 2013/11/18 03:24:30 prometheanfire Exp $ |
4 |
# $Header: $ |
|
|
5 |
|
6 |
command=/usr/bin/keystone-all |
7 |
command_args="${KEYSTONE_ARGS}" |
8 |
pidfile=/var/run/keystone.pid |
9 |
name="OpenStack Keystone" |
10 |
description="Starts both the service and administrative APIs in a single process to provide catalog, authorization, and authentication services for OpenStack" |
11 |
start_stop_daemon_args="--background --make-pidfile --user ${KEYSTONE_USER:-keystone}" |
12 |
required_files="${KEYSTONE_CONF:-/etc/keystone/keystone.conf}" |
5 |
|
13 |
|
6 |
depend() { |
14 |
depend() { |
7 |
need net |
15 |
need net |
8 |
} |
16 |
} |
9 |
|
|
|
10 |
BASENAME=$(echo $SVCNAME | cut -d '-' -f 1) |
11 |
|
12 |
checkconfig() { |
13 |
if [ ! -r /etc/conf.d/$BASENAME ]; then |
14 |
eerror "No keystone service confd file found: /etc/conf.d/$BASENAME)" |
15 |
return 1 |
16 |
fi |
17 |
. /etc/conf.d/$BASENAME |
18 |
|
19 |
if [ ! -r ${CONFIG_FILE} ]; then |
20 |
eerror "No keystone config file found: ${CONFIG_FILE})" |
21 |
return 1 |
22 |
fi |
23 |
|
24 |
return 0 |
25 |
} |
26 |
|
27 |
|
28 |
start() { |
29 |
checkconfig || return $? |
30 |
. /etc/conf.d/$BASENAME |
31 |
|
32 |
if [ ! -d ${PID_PATH} ]; then |
33 |
mkdir ${PID_PATH} |
34 |
fi |
35 |
|
36 |
ebegin "Starting ${SVCNAME}" |
37 |
|
38 |
start-stop-daemon --start --quiet --make-pidfile --pidfile "${PID_PATH}/${SVCNAME}.pid" --exec /usr/bin/${SVCNAME}-all --background -- --config-file=${CONFIG_FILE} --log-file=${LOG_FILE} |
39 |
|
40 |
eend $? "Failed to start ${SVCNAME}" |
41 |
} |
42 |
|
43 |
stop() { |
44 |
checkconfig || return $? |
45 |
. /etc/conf.d/$BASENAME |
46 |
|
47 |
ebegin "Stopping ${SVCNAME}" |
48 |
|
49 |
start-stop-daemon --stop --pidfile "${PID_PATH}/${SVCNAME}.pid" \ |
50 |
--exec /usr/bin/${SVCNAME}-all |
51 |
eend $? "Failed to stop ${SVCNAME}" |
52 |
} |
53 |
|
54 |
#restart() { |
55 |
# |
56 |
#} |