Merge lp:~smoser/ubuntu/precise/sysvinit/rc.local.d into lp:ubuntu/precise/sysvinit

Proposed by Scott Moser
Status: Work in progress
Proposed branch: lp:~smoser/ubuntu/precise/sysvinit/rc.local.d
Merge into: lp:ubuntu/precise/sysvinit
Diff against target: 100 lines (+55/-0)
5 files modified
debian/changelog (+8/-0)
debian/initscripts.conffiles (+1/-0)
debian/initscripts.postinst (+1/-0)
debian/initscripts.postrm (+1/-0)
debian/src/initscripts/etc/init.d/rc.local.d (+44/-0)
To merge this branch: bzr merge lp:~smoser/ubuntu/precise/sysvinit/rc.local.d
Reviewer Review Type Date Requested Status
Scott Moser Needs Resubmitting
Clint Byrum (community) Needs Information
Ubuntu branches Pending
Review via email: mp+88323@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

This adds an additional rc.sysv script named 'rc.local.d' which will executable programs in /etc/rc.local.d via run-parts.

If run-parts is not available, or the directory /etc/rc.local.d does not exist, it will exit silently with success.

Revision history for this message
Scott Moser (smoser) wrote :

2 other thoughts:
 * I chose adding rc.local.d versus modifying /etc/init.d/rc.local to add 'rc.local.d' support, because I felt that would have been more difficult to reliably detect if rc.local.d support was present. This seems less surprising.
 * I had implemented this as an upstart job also, but felt sysv script fit better with the 'initscripts' package, which is where rc.local was provided.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Scott this is pretty cool! However, I actually think rc.local *should* be moved to be run by an upstart job rather than rc2.d links. It should be:

# /etc/init/rc-local.conf
start on stopped rc RUNLEVEL=[2345]
task

description "/etc/rc.local"

exec /etc/rc.local start

This would put it pretty much as late as possible in the boot, though it still does not address the fact that some things may be starting in parallel still if they have something like:

start on runlevel [2345]

But that is an issue with the current one as well.

Anyway, that should become part of upstart, and then the update-rc.d removed from initscripts. Then your job gets simpler:

# /etc/init/rc-local-d.conf
start on stopped rc-local
task

description "local boot scripts (/etc/rc.local.d)"

pre-start script
  [ -d /etc/rc.local.d ] || stop
  command -v run-parts >/dev/null 2>&1 || stop
end script

exec run-parts /etc/rc.local.d

I like the idea of having two separate jobs because the user will get messages in noquiet boot (default for servers) that show

* Starting /etc/rc.local
* Stopping /etc/rc.local
* Starting local boot scripts (/etc/rc.local.d)
* Stopping local boot scripts (/etc/rc.local.d)

Would you be willing to move it over to upstart?

review: Needs Information
Revision history for this message
Scott Moser (smoser) wrote :

>
> I like the idea of having two separate jobs because the user will get messages
> in noquiet boot (default for servers) that show
>
> * Starting /etc/rc.local
> * Stopping /etc/rc.local
> * Starting local boot scripts (/etc/rc.local.d)
> * Stopping local boot scripts (/etc/rc.local.d)
>
> Would you be willing to move it over to upstart?

I have no objections to rc.local being a upstart job, but having the "sysvinit" package lay down a upstart job just seems strange at best to me. Thats why I stuck with sysvinit style start script.

If we think that rc.local should be an upstart job (and then, rc.local.d following that), I think thats a different bug. I really don't have a strong feeling.

review: Needs Resubmitting
Revision history for this message
Scott Moser (smoser) wrote :

I've updated bug 915215 in comment 7 with a summary of the state of this bug/feature.

Unmerged revisions

168. By Scott Moser

d/src/initscripts/etc/init.d/rc.local.d: add rc.local.d
sysv-init script for executing things in /etc/rc.local.d
in run-parts style (LP: #915215)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-12-13 00:16:41 +0000
+++ debian/changelog 2012-01-30 16:08:24 +0000
@@ -1,3 +1,11 @@
1sysvinit (2.88dsf-13.10ubuntu9) UNRELEASED; urgency=low
2
3 * d/src/initscripts/etc/init.d/rc.local.d: add rc.local.d
4 sysv-init script for executing things in /etc/rc.local.d
5 in run-parts style (LP: #915215)
6
7 -- Scott Moser <smoser@ubuntu.com> Mon, 30 Jan 2012 10:22:53 -0500
8
1sysvinit (2.88dsf-13.10ubuntu8) precise; urgency=low9sysvinit (2.88dsf-13.10ubuntu8) precise; urgency=low
210
3 * d/src/initscripts/etc/init.d/sendsigs: wait up to 300 extra11 * d/src/initscripts/etc/init.d/sendsigs: wait up to 300 extra
412
=== modified file 'debian/initscripts.conffiles'
--- debian/initscripts.conffiles 2011-07-12 17:08:08 +0000
+++ debian/initscripts.conffiles 2012-01-30 16:08:24 +0000
@@ -5,6 +5,7 @@
5/etc/init.d/killprocs5/etc/init.d/killprocs
6/etc/init.d/ondemand6/etc/init.d/ondemand
7/etc/init.d/rc.local7/etc/init.d/rc.local
8/etc/init.d/rc.local.d
8/etc/init.d/reboot9/etc/init.d/reboot
9/etc/init.d/sendsigs10/etc/init.d/sendsigs
10/etc/init.d/single11/etc/init.d/single
1112
=== modified file 'debian/initscripts.postinst'
--- debian/initscripts.postinst 2011-07-13 20:44:04 +0000
+++ debian/initscripts.postinst 2012-01-30 16:08:24 +0000
@@ -181,6 +181,7 @@
181update-rc.d single start 90 1 . >/dev/null || exit $?181update-rc.d single start 90 1 . >/dev/null || exit $?
182update-rc.d ondemand start 99 2 3 4 5 . >/dev/null || exit $?182update-rc.d ondemand start 99 2 3 4 5 . >/dev/null || exit $?
183update-rc.d rc.local start 99 2 3 4 5 . >/dev/null || exit $?183update-rc.d rc.local start 99 2 3 4 5 . >/dev/null || exit $?
184update-rc.d rc.local.d start 99 2 3 4 5 . >/dev/null || exit $?
184#update-rc.d stop-bootlogd-single start 99 S . >/dev/null || exit $?185#update-rc.d stop-bootlogd-single start 99 S . >/dev/null || exit $?
185#update-rc.d stop-bootlogd start 99 2 3 4 5 . >/dev/null || exit $?186#update-rc.d stop-bootlogd start 99 2 3 4 5 . >/dev/null || exit $?
186187
187188
=== modified file 'debian/initscripts.postrm'
--- debian/initscripts.postrm 2011-07-12 07:41:11 +0000
+++ debian/initscripts.postrm 2012-01-30 16:08:24 +0000
@@ -49,6 +49,7 @@
49 update-rc.d stop-bootlogd remove >/dev/null || exit $?49 update-rc.d stop-bootlogd remove >/dev/null || exit $?
50 update-rc.d stop-bootlogd-single remove >/dev/null || exit $?50 update-rc.d stop-bootlogd-single remove >/dev/null || exit $?
51 update-rc.d rc.local remove >/dev/null || exit $?51 update-rc.d rc.local remove >/dev/null || exit $?
52 update-rc.d rc.local.d remove >/dev/null || exit $?
52 update-rc.d single remove >/dev/null || exit $?53 update-rc.d single remove >/dev/null || exit $?
53 update-rc.d killprocs remove >/dev/null || exit $?54 update-rc.d killprocs remove >/dev/null || exit $?
54 update-rc.d sendsigs remove >/dev/null || exit $?55 update-rc.d sendsigs remove >/dev/null || exit $?
5556
=== added file 'debian/src/initscripts/etc/init.d/rc.local.d'
--- debian/src/initscripts/etc/init.d/rc.local.d 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/rc.local.d 2012-01-30 16:08:24 +0000
@@ -0,0 +1,44 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: rc.local.d
4# Required-Start: $remote_fs $syslog $all
5# Required-Stop:
6# Default-Start: 2 3 4 5
7# Default-Stop:
8# Short-Description: Run files in /etc/rc.local.d if they exist
9### END INIT INFO
10
11
12PATH=/sbin:/usr/sbin:/bin:/usr/bin
13
14. /lib/init/vars.sh
15. /lib/lsb/init-functions
16
17do_start() {
18 if [ -d /etc/rc.local.d ] && command -v run-parts >/dev/null; then
19 [ "$VERBOSE" != no ] &&
20 log_begin_msg "Running local boot scripts (/etc/rc.local.d)"
21 run-parts /etc/rc.local.d
22 ES=$?
23 [ "$VERBOSE" != no ] && log_end_msg $ES
24 return $ES
25 fi
26}
27
28case "$1" in
29 start)
30 do_start
31 ;;
32 restart|reload|force-reload)
33 echo "Error: argument '$1' not supported" >&2
34 exit 3
35 ;;
36 stop)
37 ;;
38 *)
39 echo "Usage: $0 start|stop" >&2
40 exit 3
41 ;;
42esac
43
44# vi: ts=4 syntax=sh noexpandtab

Subscribers

People subscribed via source and target branches

to all changes: