[med-svn] r13474 - trunk/packages/gnuhealth/trunk/debian

Emilien Klein e2jk-guest at alioth.debian.org
Fri May 3 21:08:09 UTC 2013


Author: e2jk-guest
Date: 2013-05-03 21:08:09 +0000 (Fri, 03 May 2013)
New Revision: 13474

Added:
   trunk/packages/gnuhealth/trunk/debian/gnuhealth-server.default
   trunk/packages/gnuhealth/trunk/debian/gnuhealth-server.init
Log:
Create gnuhealth-server, the deamon for running GNU Health


Added: trunk/packages/gnuhealth/trunk/debian/gnuhealth-server.default
===================================================================
--- trunk/packages/gnuhealth/trunk/debian/gnuhealth-server.default	                        (rev 0)
+++ trunk/packages/gnuhealth/trunk/debian/gnuhealth-server.default	2013-05-03 21:08:09 UTC (rev 13474)
@@ -0,0 +1,17 @@
+# Defaults for gnuhealth-server initscript
+
+# Specify the user name (Default: gnuhealth).
+DAEMONUSER="gnuhealth"
+
+# Specify an alternate config file (Default: /etc/gnuhealth-server.conf).
+CONFIGFILE="/etc/gnuhealth/gnuhealth-server.conf"
+
+# Specify the log file (Default: /var/log/gnuhealth/gnuhealth-server.log).
+LOGFILE="/var/log/gnuhealth/gnuhealth-server.log"
+
+# Specify the locale for the server to run (Default: en_US).
+#LANG="fr_FR.UTF-8"
+
+# Additional options that are passed to the Daemon.
+# i.e. to increase the verbosity of the server log add -v
+DAEMON_OPTS=" --config=${CONFIGFILE} --logfile=${LOGFILE}"

Added: trunk/packages/gnuhealth/trunk/debian/gnuhealth-server.init
===================================================================
--- trunk/packages/gnuhealth/trunk/debian/gnuhealth-server.init	                        (rev 0)
+++ trunk/packages/gnuhealth/trunk/debian/gnuhealth-server.init	2013-05-03 21:08:09 UTC (rev 13474)
@@ -0,0 +1,102 @@
+#!/bin/sh
+
+# Based on the init script for tryton-server
+
+### BEGIN INIT INFO
+# Provides:             gnuhealth-server
+# Required-Start:       $syslog $remote_fs
+# Required-Stop:        $syslog $remote_fs
+# Should-Start:         $network postgresql mysql
+# Should-Stop:          $network postgresql mysql
+# Default-Start:        2 3 4 5
+# Default-Stop:         0 1 6
+# Short-Description:    GNU Health Server (Tryton)
+# Description:          Deamon for running GNU Health. This is a wrapper around
+#                       Tryton, an Application Platform serving as a base for
+#                       a complete ERP software.
+### END INIT INFO
+
+PATH="/sbin:/bin:/usr/sbin:/usr/bin"
+DAEMON="/usr/bin/trytond"
+
+test -x "${DAEMON}" || exit 0
+
+NAME="gnuhealth-server"
+DESC="GNU Health Server (Tryton Application Platform)"
+DAEMONUSER="gnuhealth"
+PIDDIR="/var/run/${NAME}"
+PIDFILE="${PIDDIR}/${NAME}.pid"
+LOGFILE="/var/log/gnuhealth/${NAME}.log"
+DEFAULTS="/etc/default/gnuhealth-server"
+CONFIGFILE="/etc/gnuhealth/${NAME}.conf"
+DAEMON_OPTS="--config=${CONFIGFILE} --logfile=${LOGFILE}"
+
+# Include gnuhealth-server defaults if available
+if [ -r "${DEFAULTS}" ]
+then
+	. "${DEFAULTS}"
+fi
+
+. /lib/lsb/init-functions
+
+# Make sure gnuhealth-server is started with configured locale
+if [ -n "${LANG}" ]
+then
+	LANG="${LANG}"
+	export LANG
+fi
+
+set -e
+
+do_start ()
+{
+	if [ ! -d "${PIDDIR}" ]
+	then
+		mkdir -p "${PIDDIR}"
+		chown "${DAEMONUSER}":"${DAEMONUSER}" "${PIDDIR}"
+	fi
+
+	start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
+		--chuid ${DAEMONUSER} --background --make-pidfile \
+		--exec ${DAEMON} -- ${DAEMON_OPTS}
+}
+
+do_stop ()
+{
+	start-stop-daemon --stop --quiet --pidfile ${PIDFILE} --oknodo
+}
+
+case "${1}" in
+	start)
+		log_daemon_msg "Starting ${DESC}" "${NAME}"
+		do_start
+		log_end_msg ${?}
+		;;
+
+	stop)
+		log_daemon_msg "Stopping ${DESC}" "${NAME}"
+		do_stop
+		log_end_msg ${?}
+		;;
+
+	restart|force-reload)
+		log_daemon_msg "Restarting ${DESC}" "${NAME}"
+		do_stop
+		sleep 1
+		do_start
+		log_end_msg ${?}
+	;;
+
+	status)
+		status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME} && \
+		exit 0 || exit ${?}
+	;;
+
+	*)
+		N="/etc/init.d/${NAME}"
+		echo "Usage: ${N} {start|stop|restart|force-reload|status}" >&2
+		exit 1
+		;;
+esac
+
+exit 0




More information about the debian-med-commit mailing list