[SCM] Debian packaging of Pinto CPAN distribution branch, master, updated. 80fbfc94ab23430843ec5491886bb442040c833c
Oleg Gashev
oleg at gashev.net
Sat Jun 1 20:54:44 UTC 2013
The following commit has been merged in the master branch:
commit 062a299ac3017d281c15a9d6cfb6f4bcebed71d8
Author: Oleg Gashev <oleg at gashev.net>
Date: Sat Jun 1 20:50:38 2013 +0000
Added default, init.d scripts.
diff --git a/debian/pinto.default b/debian/pinto.default
new file mode 100644
index 0000000..331fcc5
--- /dev/null
+++ b/debian/pinto.default
@@ -0,0 +1,13 @@
+################################################
+#
+# pintod's default file, for generic sys config
+#
+################################################
+
+# control if we start pintod at init or not
+# 1 = start
+# anything else = don't start
+START_PINTOD=0
+
+# command line options
+PINTOD_OPTS="--root=/var/pinto --access-log=/var/log/pinto/access.log --error-log=/var/log/pinto/error.log --daemonize"
diff --git a/debian/pinto.init b/debian/pinto.init
new file mode 100644
index 0000000..0a79116
--- /dev/null
+++ b/debian/pinto.init
@@ -0,0 +1,73 @@
+#! /bin/sh
+
+### BEGIN INIT INFO
+# Provides: pintod
+# Required-Start: $network $syslog
+# Required-Stop: $network $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: pinto perl module repository
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/pintod
+NAME=pintod
+PIDFILE=/var/run/pinto/$NAME.pid
+DEFAULTS_FILE=/etc/default/pinto
+DESC="pinto perl module repository"
+
+umask 0037
+
+test -f $DAEMON || exit 0
+
+set -e
+
+[ -f $DEFAULTS_FILE ] && . $DEFAULTS_FILE
+
+. /lib/lsb/init-functions
+
+[ "$PINTOD_OPTS" ] && OPTIONS="$PINTOD_OPTS --pid $PIDFILE"
+
+start_if_configured() {
+ if [ $START_PINTOD -ne 1 ]; then
+ log_warning_msg "$NAME disabled: not starting. To enable it edit $DEFAULTS_FILE"
+ exit 0
+ else
+ log_daemon_msg "Starting $DESC" "$NAME"
+ if ! START_ERROR=`start-stop-daemon --oknodo --chuid pinto -u pinto --start --pidfile $PIDFILE --exec $DAEMON -- $OPTIONS 2>&1`; then
+ # don't fail the upgrade if it fails to start
+ echo -n " "
+ log_action_end_msg 1 "$START_ERROR"
+ exit 0
+ else
+ log_end_msg 0
+ fi
+ fi
+}
+
+case "$1" in
+ start)
+ start_if_configured
+ ;;
+ stop)
+ log_daemon_msg "Stopping $DESC" "$NAME"
+ killproc -p $PIDFILE /usr/bin/starman
+ RETVAL=$?
+ [ $RETVAL = 0 ] && rm -f $PIDFILE
+ log_end_msg "$RETVAL"
+ ;;
+ restart|reload|force-reload)
+ log_daemon_msg "Stopping $DESC" "$NAME"
+ start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
+ log_end_msg 0
+ sleep 1
+ start_if_configured
+ ;;
+ *)
+ log_warning_msg "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
--
Debian packaging of Pinto CPAN distribution
More information about the Pkg-perl-cvs-commits
mailing list