summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python
diff options
context:
space:
mode:
authorMihai Prica <prica.mihai@gmail.com>2013-06-11 14:37:05 +0300
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-08-28 18:41:56 -0400
commit03412fe2cee41990c101ba69ab40db871467754f (patch)
tree699d4a8c6e4a1e88713eb88078905ba1d153448e /meta-openstack/recipes-devtools/python
parentc199e0a83897fc9c0d24c018767171a6feed2108 (diff)
downloadmeta-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')
-rw-r--r--meta-openstack/recipes-devtools/python/python-keystone/keystone66
-rw-r--r--meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb12
2 files changed, 77 insertions, 1 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
8DESC="keystone"
9DAEMON="/usr/bin/keystone-all"
10PIDFILE="/var/run/keystone-all.pid"
11
12start ()
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
37stop ()
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
49case "$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 ;;
64esac
65
66exit 0
diff --git a/meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb b/meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb
index b543b13..d80f9bb 100644
--- a/meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb
+++ b/meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb
@@ -11,6 +11,7 @@ SRC_URI = "https://launchpad.net/keystone/grizzly/${PV}/+download/${SRCNAME}-${P
11 file://keystone.conf \ 11 file://keystone.conf \
12 file://identity.sh \ 12 file://identity.sh \
13 file://openrc \ 13 file://openrc \
14 file://keystone \
14 " 15 "
15 16
16SRC_URI[md5sum] = "f82189cd7e3f0955e32c60e41f4120da" 17SRC_URI[md5sum] = "f82189cd7e3f0955e32c60e41f4120da"
@@ -18,7 +19,7 @@ SRC_URI[sha256sum] = "34347a3242a40d93b98c3722e6f3fbc112bc1c9ef20c045c3d40637e45
18 19
19S = "${WORKDIR}/${SRCNAME}-${PV}" 20S = "${WORKDIR}/${SRCNAME}-${PV}"
20 21
21inherit setuptools 22inherit setuptools update-rc.d
22 23
23SERVICE_TOKEN = "password" 24SERVICE_TOKEN = "password"
24 25
@@ -36,6 +37,11 @@ do_install_append() {
36 install -m 600 ${S}/etc/logging.conf.sample ${KEYSTONE_CONF_DIR}/logging.conf 37 install -m 600 ${S}/etc/logging.conf.sample ${KEYSTONE_CONF_DIR}/logging.conf
37 install -m 600 ${S}/etc/policy.json ${KEYSTONE_CONF_DIR}/policy.json 38 install -m 600 ${S}/etc/policy.json ${KEYSTONE_CONF_DIR}/policy.json
38 39
40 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
41 install -d ${D}${sysconfdir}/init.d
42 install -m 0755 ${WORKDIR}/keystone ${D}${sysconfdir}/init.d/keystone
43 fi
44
39 # Create the sqlite database 45 # Create the sqlite database
40 touch ${KEYSTONE_CONF_DIR}/keystone.db 46 touch ${KEYSTONE_CONF_DIR}/keystone.db
41} 47}
@@ -53,6 +59,7 @@ pkg_postinst_${SRCNAME} () {
53 keystone-manage pki_setup 59 keystone-manage pki_setup
54 # quick fix 60 # quick fix
55 echo "source /etc/keystone/openrc" > /home/root/.bashrc 61 echo "source /etc/keystone/openrc" > /home/root/.bashrc
62 /etc/init.d/keystone start
56 sleep 1 63 sleep 1
57 bash /etc/keystone/identity.sh 64 bash /etc/keystone/identity.sh
58} 65}
@@ -83,3 +90,6 @@ RDEPENDS_${PN} += "python-pam \
83 90
84RDEPENDS_${SRCNAME} = "${PN} \ 91RDEPENDS_${SRCNAME} = "${PN} \
85 postgresql postgresql-client python-psycopg2" 92 postgresql postgresql-client python-psycopg2"
93
94INITSCRIPT_PACKAGES = "${SRCNAME}"
95INITSCRIPT_NAME_${SRCNAME} = "keystone"