[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lnst-developers
Subject:    [lnst] adding initscript for lnst-slave service
From:       Jiří Pírko <jirka () fedoraproject ! org>
Date:       2013-02-05 16:03:59
Message-ID: 20130205160359.50891229E () fedorahosted ! org
[Download RAW message or body]

commit f901a34b0a5c4063f63c5d9f035c2c6da6710cc1
Author: Jan Tluka <jtluka@redhat.com>
Date:   Tue Feb 5 14:25:03 2013 +0100

    adding initscript for lnst-slave service
    
    We'd like to be able to run LNST framework on older releases, e.g.
    RHEL6, and since it's not using systemd the initscript for the
    lnst-slave daemon is needed.
    
    Signed-off-by: Jan Tluka <jtluka@redhat.com>

 dist/lnst-slave |  105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 105 insertions(+), 0 deletions(-)
---
diff --git a/dist/lnst-slave b/dist/lnst-slave
new file mode 100755
index 0000000..b18f46a
--- /dev/null
+++ b/dist/lnst-slave
@@ -0,0 +1,105 @@
+#!/bin/bash
+#
+# lnst-slave   Starts up the LNST slave daemon
+#
+# chkconfig: - 20 80
+# description: LNST is a framework to automate network configuration and
+#              testing. This service starts up the LNST slave daemon.
+#
+# processname: lnst-slave
+# pidfile: /var/run/lnst-slave.pid
+
+### BEGIN INIT INFO
+# Provides: lnst-slave
+# Required-Start: $local_fs $network
+# Required-Stop: $local_fs
+# Short-Description: Starts up the LNST slave daemon
+# Description: LNST is a framework to automate network configuration and
+#              testing. This service starts up the LNST slave daemon.
+### END INIT INFO
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+prog="lnst-slave"
+lockfile=/var/lock/subsys/$prog
+
+# Some functions to make the below more readable
+LNST=/usr/bin/lnst-slave
+PID_FILE=/var/run/lnst-slave.pid
+OPTIONS="--daemonize"
+
+start()
+{
+    [ -x $LNST ] || exit 5
+
+    echo -n $"Starting $prog: "
+    $LNST $OPTIONS && success || failure
+    RETVAL=$?
+    [ $RETVAL -eq 0 ] && touch $lockfile
+    echo
+    return $RETVAL
+}
+
+stop()
+{
+    echo -n $"Stopping $prog: "
+    killproc lnst-slave
+    RETVAL=$?
+    [ $RETVAL -eq 0 ] && rm -f $lockfile
+    echo
+}
+
+reload() {
+    restart
+}
+
+restart() {
+    stop
+    start
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status lnst-slave
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        $1
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    status)
+        rh_status
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
+        RETVAL=2
+esac
+exit $RETVAL
_______________________________________________
LNST-developers mailing list
LNST-developers@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic