chiark / gitweb /
examples/disorder.init.in: Collect default environment settings.
[disorder] / examples / disorder.init.in
index 602effc433905fc4b0f188d4960972a15cc85034..29524dbd35945e968505c126762970db3057cfd7 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh
 #
 # This file is part of DisOrder.
-# Copyright (C) 2004, 2005, 2007 Richard Kettlewell
+# Copyright (C) 2004, 2005, 2007, 2009 Richard Kettlewell
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+### BEGIN INIT INFO
+# Provides:          disorder
+# Required-Start:    $local_fs $network $named $remote_fs $syslog $time
+# Required-Stop:     $local_fs $network $named $remote_fs $syslog $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start and stop DisOrder
+# Description:       DisOrder is a multi-user software jukebox.
+### END INIT INFO
+
 set -e
 
+. /lib/lsb/init-functions
+
 DAEMON=sbindir/disorderd
 CLIENT="bindir/disorder --local"
 
 PATH="$PATH:sbindir"
 
+if [ -r /etc/default/locale ]; then
+  . /etc/default/locale
+  for var in \
+    LANG LANGUAGE LC_ALL \
+    LC_ADDRESS LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT \
+    LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME
+  do
+    eval p=\${$var+t}
+    case ${p+t} in t) export $var ;; esac
+  done
+fi
+
+if [ -r /etc/default/disorder ]; then
+  . sysconfdir/default/disorder
+fi
+
 start_debian() {
   printf "Starting DisOrder server: disorderd"
   start-stop-daemon -S -q -x ${DAEMON}