diff options
| author | Dan McGregor <dan.mcgregor@usask.ca> | 2013-06-03 22:15:20 +0000 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-06-12 16:23:22 +0200 |
| commit | 348e00fedd4cc380c5c74d90b546f2444327f224 (patch) | |
| tree | d87b1b9fadb21b7bb848b2bd8be7ebdd6ff9bdf4 /meta-oe/recipes-connectivity | |
| parent | 5be2e7a096561c8ebcc8cd1188a70a02b20d3df8 (diff) | |
| download | meta-openembedded-348e00fedd4cc380c5c74d90b546f2444327f224.tar.gz | |
gateone: Add sysv init script
Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-connectivity')
| -rw-r--r-- | meta-oe/recipes-connectivity/gateone/gateone/gateone-init | 47 | ||||
| -rw-r--r-- | meta-oe/recipes-connectivity/gateone/gateone_git.bb | 7 |
2 files changed, 53 insertions, 1 deletions
diff --git a/meta-oe/recipes-connectivity/gateone/gateone/gateone-init b/meta-oe/recipes-connectivity/gateone/gateone/gateone-init new file mode 100644 index 0000000000..a1cf5ce7e9 --- /dev/null +++ b/meta-oe/recipes-connectivity/gateone/gateone/gateone-init | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | #!/bin/sh -e | ||
| 2 | ### BEGIN INIT INFO | ||
| 3 | # Provides: gateone | ||
| 4 | # Required-Start: networking | ||
| 5 | # Default-Start: 2 3 4 5 | ||
| 6 | # Default-Stop: 0 1 6 | ||
| 7 | # Short-Description: Gateone HTML5 ssh client | ||
| 8 | # Description: Gateone HTML5 terminal emulator and SSH client. | ||
| 9 | ### END INIT INFO | ||
| 10 | |||
| 11 | . /etc/init.d/functions | ||
| 12 | |||
| 13 | NAME=gateone | ||
| 14 | DAEMON=/var/lib/gateone/gateone.py | ||
| 15 | PIDFILE=/var/run/gateone.pid | ||
| 16 | WORKDIR=/var/lib/gateone | ||
| 17 | |||
| 18 | do_start() { | ||
| 19 | cd $WORKDIR | ||
| 20 | /usr/bin/python $DAEMON > /dev/null 2>&1 & | ||
| 21 | cd $OLDPWD | ||
| 22 | } | ||
| 23 | |||
| 24 | do_stop() { | ||
| 25 | kill -TERM `cat $PIDFILE` | ||
| 26 | } | ||
| 27 | |||
| 28 | case "$1" in | ||
| 29 | start) | ||
| 30 | echo "Starting gateone" | ||
| 31 | do_start | ||
| 32 | ;; | ||
| 33 | stop) | ||
| 34 | echo "Stopping gateone" | ||
| 35 | do_stop | ||
| 36 | ;; | ||
| 37 | restart|force-reload) | ||
| 38 | echo "Restart gateone" | ||
| 39 | do_stop | ||
| 40 | sleep 1 | ||
| 41 | do_start | ||
| 42 | ;; | ||
| 43 | *) | ||
| 44 | echo "Usage: $0 {start|stop|restart|force-reload}" >&2 | ||
| 45 | exit 1 | ||
| 46 | ;; | ||
| 47 | esac | ||
diff --git a/meta-oe/recipes-connectivity/gateone/gateone_git.bb b/meta-oe/recipes-connectivity/gateone/gateone_git.bb index e5b8527c5d..85c32cc29a 100644 --- a/meta-oe/recipes-connectivity/gateone/gateone_git.bb +++ b/meta-oe/recipes-connectivity/gateone/gateone_git.bb | |||
| @@ -10,11 +10,12 @@ SRC_URI = "git://github.com/liftoff/GateOne.git \ | |||
| 10 | file://gateone-avahi.service \ | 10 | file://gateone-avahi.service \ |
| 11 | file://server.conf \ | 11 | file://server.conf \ |
| 12 | file://gateone.service \ | 12 | file://gateone.service \ |
| 13 | file://gateone-init \ | ||
| 13 | " | 14 | " |
| 14 | 15 | ||
| 15 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
| 16 | 17 | ||
| 17 | inherit distutils allarch python-dir systemd | 18 | inherit distutils allarch python-dir systemd update-rc.d |
| 18 | 19 | ||
| 19 | export prefix = "${localstatedir}/lib" | 20 | export prefix = "${localstatedir}/lib" |
| 20 | 21 | ||
| @@ -28,6 +29,9 @@ do_install_append() { | |||
| 28 | 29 | ||
| 29 | install -d ${D}${systemd_unitdir}/system | 30 | install -d ${D}${systemd_unitdir}/system |
| 30 | install -m 0644 ${WORKDIR}/gateone.service ${D}${systemd_unitdir}/system | 31 | install -m 0644 ${WORKDIR}/gateone.service ${D}${systemd_unitdir}/system |
| 32 | |||
| 33 | install -d ${D}${sysconfdir}/init.d | ||
| 34 | install -m 0755 ${WORKDIR}/gateone-init ${D}${sysconfdir}/init.d/gateone | ||
| 31 | } | 35 | } |
| 32 | 36 | ||
| 33 | FILES_${PN} = "${localstatedir}/lib ${localstatedir}/log ${localstatedir}/volatile/log ${base_libdir} ${sysconfdir} ${PYTHON_SITEPACKAGES_DIR}" | 37 | FILES_${PN} = "${localstatedir}/lib ${localstatedir}/log ${localstatedir}/volatile/log ${base_libdir} ${sysconfdir} ${PYTHON_SITEPACKAGES_DIR}" |
| @@ -63,3 +67,4 @@ RDEPENDS_${PN} = "file \ | |||
| 63 | " | 67 | " |
| 64 | 68 | ||
| 65 | SYSTEMD_SERVICE_${PN} = "gateone.service" | 69 | SYSTEMD_SERVICE_${PN} = "gateone.service" |
| 70 | INITSCRIPT_NAME = "gateone" | ||
