From 96aece84b3548826a0d9f7e534a4a68300f0f3e5 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Mon, 20 Apr 2015 21:43:32 +0200 Subject: [PATCH] Init scripts for Debian and Redhat. --- ...ptform.init.d => scriptform.init.d_debian} | 0 contrib/scriptform.init.d_redhat | 68 +++++++++++++++++++ 2 files changed, 68 insertions(+) rename contrib/{scriptform.init.d => scriptform.init.d_debian} (100%) create mode 100755 contrib/scriptform.init.d_redhat diff --git a/contrib/scriptform.init.d b/contrib/scriptform.init.d_debian similarity index 100% rename from contrib/scriptform.init.d rename to contrib/scriptform.init.d_debian diff --git a/contrib/scriptform.init.d_redhat b/contrib/scriptform.init.d_redhat new file mode 100755 index 0000000..477408a --- /dev/null +++ b/contrib/scriptform.init.d_redhat @@ -0,0 +1,68 @@ +#!/bin/bash +# +# scriptform Scriptform server +# +# chkconfig: 345 70 30 +# description: Standalone web form front-end to scripts. +# processname: scriptform + +# Source function library. +. /etc/init.d/functions + +RETVAL=0 +prog="scriptform" + +# Settings. Change these, especially FORM_CONFIG +NAME=scriptform +PIDFILE=/var/run/scriptform.pid +LOGFILE=/var/log/scriptform.log +DAEMON=/usr/bin/scriptform +FORM_CONFIG= +PORT=8080 +DAEMON_ARGS="--port $PORT --pid-file $PIDFILE --log-file $LOGFILE $FORM_CONFIG" + +start() { + echo -n "Starting $prog: " + $DAEMON $DAEMON_ARGS + RETVAL=$? + echo $RETVAL + echo + return $RETVAL +} + +stop() { + echo -n "Shutting down $prog: " + $DAEMON --stop $DAEMON_ARGS && success || failure + RETVAL=$? + echo $RETVAL + echo + return $RETVAL +} + +status() { + echo -n "Checking $prog status: " + [ \! -e $PIDFILE ] + RETVAL=$? + return $RETVAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status + ;; + restart) + stop + start + ;; + *) + echo "Usage: $prog {start|stop|status|restart}" + exit 1 + ;; +esac +exit $RETVAL