diff options
| author | Mihai Prica <prica.mihai@gmail.com> | 2013-06-11 14:37:05 +0300 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-08-28 18:41:56 -0400 |
| commit | 03412fe2cee41990c101ba69ab40db871467754f (patch) | |
| tree | 699d4a8c6e4a1e88713eb88078905ba1d153448e /meta-openstack/recipes-devtools/python/python-keystone | |
| parent | c199e0a83897fc9c0d24c018767171a6feed2108 (diff) | |
| download | meta-cloud-services-03412fe2cee41990c101ba69ab40db871467754f.tar.gz | |
python-keystone: Added initscript
Signed-off-by: Mihai Prica <prica.mihai@gmail.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-keystone')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-keystone/keystone | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-keystone/keystone b/meta-openstack/recipes-devtools/python/python-keystone/keystone new file mode 100644 index 0000000..bdcfcc7 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-keystone/keystone | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | ### BEGIN INIT INFO | ||
| 4 | # Provides: keystone | ||
| 5 | # Short-Description: OpenStack Identity Service | ||
| 6 | ### END INIT INFO | ||
| 7 | |||
| 8 | DESC="keystone" | ||
| 9 | DAEMON="/usr/bin/keystone-all" | ||
| 10 | PIDFILE="/var/run/keystone-all.pid" | ||
| 11 | |||
| 12 | start () | ||
| 13 | { | ||
| 14 | if [ -e $PIDFILE ]; then | ||
| 15 | PIDDIR=/proc/$(cat $PIDFILE) | ||
| 16 | if [ -d ${PIDDIR} ]; then | ||
| 17 | echo "$DESC already running." | ||
| 18 | exit 1 | ||
| 19 | else | ||
| 20 | echo "Removing stale PID file $PIDFILE" | ||
| 21 | rm -f $PIDFILE | ||
| 22 | fi | ||
| 23 | fi | ||
| 24 | |||
| 25 | echo -n "Starting $DESC..." | ||
| 26 | |||
| 27 | start-stop-daemon --start --quiet --background \ | ||
| 28 | --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} | ||
| 29 | |||
| 30 | if [ $? -eq 0 ]; then | ||
| 31 | echo "done." | ||
| 32 | else | ||
| 33 | echo "failed." | ||
| 34 | fi | ||
| 35 | } | ||
| 36 | |||
| 37 | stop () | ||
| 38 | { | ||
| 39 | echo -n "Stopping $DESC..." | ||
| 40 | start-stop-daemon --stop --quiet --pidfile $PIDFILE | ||
| 41 | if [ $? -eq 0 ]; then | ||
| 42 | echo "done." | ||
| 43 | else | ||
| 44 | echo "failed." | ||
| 45 | fi | ||
| 46 | rm -f $PIDFILE | ||
| 47 | } | ||
| 48 | |||
| 49 | case "$1" in | ||
| 50 | start) | ||
| 51 | start | ||
| 52 | ;; | ||
| 53 | stop) | ||
| 54 | stop | ||
| 55 | ;; | ||
| 56 | restart|force-reload) | ||
| 57 | stop | ||
| 58 | start | ||
| 59 | ;; | ||
| 60 | *) | ||
| 61 | echo "Usage: $0 {start|stop|force-reload|restart}" | ||
| 62 | exit 1 | ||
| 63 | ;; | ||
| 64 | esac | ||
| 65 | |||
| 66 | exit 0 | ||
