[Pkg-sysvinit-commits] r823 - in sysvinit/trunk/debian: . initscripts initscripts/etc/init.d

Petter Reinholdtsen pere at costa.debian.org
Tue Sep 5 09:38:42 UTC 2006


Author: pere
Date: 2006-09-05 09:38:42 +0000 (Tue, 05 Sep 2006)
New Revision: 823

Added:
   sysvinit/trunk/debian/initscripts/etc/init.d/rc.local
Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/initscripts/postinst
Log:
  * Add rc.local support to be more compatible with non-Debian
    distributions.  Patch from Fabio M. Di Nitto via Ubuntu.

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2006-09-05 09:29:06 UTC (rev 822)
+++ sysvinit/trunk/debian/changelog	2006-09-05 09:38:42 UTC (rev 823)
@@ -18,6 +18,8 @@
     mount NFS file systems after the network is available.  Based on
     patch from Ubuntu.  Modified to rewrite mountnfs.sh instead of
     renaming it to waitnfs.sh.  (Closes: #360123
+  * Add rc.local support to be more compatible with non-Debian
+    distributions.  Patch from Fabio M. Di Nitto via Ubuntu.
 
  -- Petter Reinholdtsen <pere at debian.org>  Wed, 26 Jul 2006 11:37:23 +0200
 

Added: sysvinit/trunk/debian/initscripts/etc/init.d/rc.local
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/rc.local	                        (rev 0)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/rc.local	2006-09-05 09:38:42 UTC (rev 823)
@@ -0,0 +1,38 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          rc.local
+# Required-Start:    $local_fs $remote_fs $all
+# Required-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:
+# Short-Description: Run /etc/rc.local if it exist
+### END INIT INFO
+
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+. /lib/lsb/init-functions
+
+do_start() {
+	if [ -x /etc/rc.local ]; then
+		log_begin_msg "Running local boot scripts (/etc/rc.local)"
+		/etc/rc.local
+		log_end_msg $?
+	fi
+}
+
+case "$1" in
+    start)
+	do_start
+        ;;
+    restart|reload|force-reload)
+        echo "Error: argument '$1' not supported" >&2
+        exit 3
+        ;;
+    stop)
+        ;;
+    *)
+        echo "Usage: $0 start|stop" >&2
+        exit 3
+        ;;
+esac

Modified: sysvinit/trunk/debian/initscripts/postinst
===================================================================
--- sysvinit/trunk/debian/initscripts/postinst	2006-09-05 09:29:06 UTC (rev 822)
+++ sysvinit/trunk/debian/initscripts/postinst	2006-09-05 09:38:42 UTC (rev 823)
@@ -118,6 +118,7 @@
 updatercd reboot                 start 90 6 .
 updatercd killprocs              start 30 1 .
 updatercd single                 start 90 1 .
+updatercd rc.local               start 99 2 3 4 5 .
 updatercd rmnologin              start 99 2 3 4 5 .
 updatercd stop-bootlogd-single   start 99 S .
 updatercd stop-bootlogd          start 99 2 3 4 5 .
@@ -229,6 +230,34 @@
 fi
 
 #
+# Create /etc/rc.local on first time install and when upgrading from
+# versions before "2.86.ds1-16"
+#
+if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-16"
+then
+	if [ ! -e /etc/rc.local ]; then
+		cat << EOF > /etc/rc.local
+#!/bin/sh -e
+#
+# rc.local
+#
+# This script is executed at the end of each multiuser runlevel.
+# Make sure that the script will "exit 0" on success or any other
+# value on error.
+#
+# In order to enable or disable this script just change the execution
+# bits.
+#
+# By default this script does nothing.
+
+exit 0
+EOF
+		# make sure it's enabled by default.
+		chmod 755 /etc/rc.local
+	fi
+fi
+
+#
 # Mount virtual filesystems under /dev...not.
 # This causes problems in pbuilder.
 #




More information about the Pkg-sysvinit-commits mailing list