Merge lp:~ubuntu-core-dev/ubuntu/utopic/sysvinit/unreviewed into lp:ubuntu/utopic/sysvinit

Proposed by Dimitri John Ledkov
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~ubuntu-core-dev/ubuntu/utopic/sysvinit/unreviewed
Merge into: lp:ubuntu/utopic/sysvinit
Diff against target: 1493 lines (+1203/-47)
21 files modified
debian/changelog (+22/-0)
debian/control (+3/-2)
debian/initscripts.conffiles (+11/-0)
debian/initscripts.postinst (+36/-13)
debian/initscripts.postrm (+11/-0)
debian/initscripts.preinst (+2/-11)
debian/src/initscripts/etc/init.d/bootmisc.sh (+61/-0)
debian/src/initscripts/etc/init.d/checkfs.sh (+154/-0)
debian/src/initscripts/etc/init.d/checkroot-bootclean.sh (+44/-0)
debian/src/initscripts/etc/init.d/checkroot.sh (+364/-0)
debian/src/initscripts/etc/init.d/hostname.sh (+68/-0)
debian/src/initscripts/etc/init.d/mountall-bootclean.sh (+37/-0)
debian/src/initscripts/etc/init.d/mountall.sh (+94/-0)
debian/src/initscripts/etc/init.d/mountdevsubfs.sh (+67/-0)
debian/src/initscripts/etc/init.d/mountkernfs.sh (+74/-0)
debian/src/initscripts/etc/init.d/mountnfs-bootclean.sh (+37/-0)
debian/src/initscripts/etc/init.d/mountnfs.sh (+105/-0)
debian/src/sysv-rc/sbin/invoke-rc.d (+2/-3)
debian/src/sysv-rc/sbin/update-rc.d (+7/-4)
debian/sysv-rc.postinst (+4/-12)
debian/sysv-rc.preinst (+0/-2)
To merge this branch: bzr merge lp:~ubuntu-core-dev/ubuntu/utopic/sysvinit/unreviewed
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Steve Langasek Needs Fixing
Review via email: mp+219999@code.launchpad.net
To post a comment you must log in.
208. By Dimitri John Ledkov

   - adjust path variable in postinst to find insserv under
  /usr/lib/insserv
  - cherrypick patch for update-rc.d to lookup insserv in
  /usr/lib/insserv and /sbin.

209. By Dimitri John Ledkov

adjust legacy_boot check to examine both rc0.d and rc6.d and the
stamp file

Revision history for this message
Steve Langasek (vorlon) wrote :

On Mon, May 19, 2014 at 09:06:40AM -0000, Dimitri John Ledkov wrote:
> === modified file 'debian/initscripts.conffiles'
> --- debian/initscripts.conffiles 2013-05-17 06:03:10 +0000
> +++ debian/initscripts.conffiles 2014-05-19 09:06:30 +0000
> @@ -1,6 +1,17 @@
> +/etc/init.d/bootmisc.sh
> +/etc/init.d/checkfs.sh
> +/etc/init.d/checkroot.sh
> +/etc/init.d/checkroot-bootclean.sh
> /etc/init.d/halt
> +/etc/init.d/hostname.sh

Note that there is no /etc/init/hostname.sh.conf job at present, which means
this change will cause both /etc/init.d/hostname.sh and
/etc/init/hostname.conf to be run.

Revision history for this message
Steve Langasek (vorlon) wrote :
Download full text (4.5 KiB)

On Mon, May 19, 2014 at 09:06:40AM -0000, Dimitri John Ledkov wrote:
> @@ -1,3 +1,20 @@
> +sysvinit (2.88dsf-41ubuntu13) UNRELEASED; urgency=medium
> +
> + * Revert previous upload, but keep UPSTARTDIR defined which was still
> + used in the fallback codepath to specifically prevent configuration
> + issues in chroots.

What is the reason for this revert, which seems to me to be unrelated to the
rest of the changes? This seems like a lot of fuss for handling of upstart
jobs in a chroot, for which the right answer is almost always "install a
policy-rc.d that blocks all services from starting". Do we have a consensus
on what the right behavior is here if the host upstart does not support
chroot sessions, and no policy-rc.d is in place? Should invoke-rc.d error
out, or should it fall back to starting via the init script, which seem to
be the two options we're flipping between here?

> === modified file 'debian/control'
> --- debian/control 2013-05-17 06:03:10 +0000
> +++ debian/control 2014-05-19 09:06:30 +0000
> @@ -43,7 +43,8 @@
> Depends:
> ${misc:Depends},
> sysvinit-utils (>= 2.86.ds1-62),
> - insserv (>> 1.12.0-10)
> + insserv (>> 1.12.0-10),
> + initscripts (>= ${binary:Version})
> Breaks: initscripts (<< 2.86.ds1-63)
> Multi-Arch: foreign
> Description: System-V-like runlevel change mechanism

I don't understand this dependency addition. Maybe this is meant to be
initscripts (>= 2.88dsf-41ubuntu13), rather than initscripts (>=
${binary:Version}) ?

I notice when diffing against initscripts 2.88dsf-41 that there are some
init scripts that have not been re-added:

-/etc/init.d/bootlogs
-/etc/init.d/motd
-/etc/init.d/mtab.sh
-/etc/init.d/rmnologin

What's different about these?

> === modified file 'debian/initscripts.postinst'
> --- debian/initscripts.postinst 2013-05-17 06:03:10 +0000
> +++ debian/initscripts.postinst 2014-05-19 09:06:30 +0000
> @@ -140,6 +140,39 @@
> #
> # Links in runlevel S
> #
> +if [ -x /etc/init.d/mountkernfs.sh ]; then
> +update-rc.d mountkernfs.sh start 02 S . >/dev/null || exit $?
> +fi

<snip>

Per
<https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1312836/comments/7>,
we don't want to reintroduce the calls to update-rc.d until /after/ insserv
has been re-enabled and fully vetted (i.e., step 4 - drop the debhelper
change that causes update-rc.d to be skipped... this also applies to
sysvinit, even though sysvinit doesn't use the debhelper implementation.)

Also, please note that this postinst still contains a delta to call
update-rc.d *remove* immediately above your restored calls, which ought to
be dropped at the same time as restoring the code to add the links.

And the code in debian/initscripts.preinst which deletes these restored
initscripts definitely wants to be removed.

> === added file 'debian/src/initscripts/etc/init.d/bootmisc.sh'
> --- debian/src/initscripts/etc/init.d/bootmisc.sh 1970-01-01 00:00:00 +0000
> +++ debian/src/initscripts/etc/init.d/bootmisc.sh 2014-05-19 09:06:30 +0000
<snip>
> +# NB! on ubuntu this file is usually not used at all, as it's
> +# redundant under upstart or systemd. This file is purely introduced
> +# to enable insserv / systemd init.d s...

Read more...

Revision history for this message
Steve Langasek (vorlon) :
review: Needs Fixing
Revision history for this message
Martin Pitt (pitti) wrote :

Steve Langasek [2014-05-19 16:24 -0000]:
> Note that there is no /etc/init/hostname.sh.conf job at present,
> which means this change will cause both /etc/init.d/hostname.sh and
> /etc/init/hostname.conf to be run.

Debian has
http://anonscm.debian.org/gitweb/?p=collab-maint/sysvinit;a=commitdiff;h=0da7086
for this problem on the systemd side. So I guess we need the moral
equivalent for upstart?

Revision history for this message
Martin Pitt (pitti) wrote :

Steve Langasek [2014-05-20 1:12 -0000]:
> What is the reason for this revert, which seems to me to be unrelated to the
> rest of the changes? This seems like a lot of fuss for handling of upstart
> jobs in a chroot, for which the right answer is almost always "install a
> policy-rc.d that blocks all services from starting".

Please note that this isn't about actually starting services in a
chroot. Dimitri's intention was to replace the [ -e /etc/init/$JOB.conf ]
with "ask upstart if it knows about $JOB", and the first iteration was
"initctl status $JOB doesn't fail". That doesn't work due to what I
described in https://launchpad.net/ubuntu/+source/sysvinit/2.88dsf-41ubuntu12
but during our live builds we do have policy-rc.d, so we don't
actually start services.

So we either need a fallback like that (which isn't really correct
though), or maintain a list of possible job locations in invoke-rc.d
(like /lib/init/*.conf, /etc/upstart/overrides/*.conf, or whereever)

> Do we have a consensus on what the right behavior is here if the
> host upstart does not support chroot sessions, and no policy-rc.d is
> in place? Should invoke-rc.d error out, or should it fall back to
> starting via the init script, which seem to be the two options we're
> flipping between here?

I don't have a strong opinion about either way, but my gut feeling is
that it's more predictable to just not start anything at all if the
host upstart doesn't support chroot mode.

> > +# NB! on ubuntu this file is usually not used at all, as it's
> > +# redundant under upstart or systemd. This file is purely introduced
> > +# to enable insserv / systemd init.d scripts activation
> > +. /lib/lsb/init-functions
>
> IMHO the benefit of this expository comment is outweighed by the detriment
> of having the extra delta in these scripts; but that's just my opinion.

+1

Thanks,
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)

Revision history for this message
Steve Langasek (vorlon) wrote :

On Tue, May 20, 2014 at 06:33:19AM -0000, Martin Pitt wrote:
> Debian has
> http://anonscm.debian.org/gitweb/?p=collab-maint/sysvinit;a=commitdiff;h=0da7086
> for this problem on the systemd side. So I guess we need the moral
> equivalent for upstart?

The use of '.sh' extensions for init scripts is deprecated, and there is a
small and finite set that need to be handled. Furthermore, mapping these
job names would need to be done in C for upstart (since it's startpar that
provides the bridging at boot time), and not all of the .sh init scripts
could be handled as direct translations due to differences in the job
lifecycles (services vs. tasks in upstart). So the solution here is just to
provide the missing /etc/init/hostname.sh.conf wrapper job, to go with the
other wrapper jobs that mountall is already providing.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Download full text (8.6 KiB)

> On Mon, May 19, 2014 at 09:06:40AM -0000, Dimitri John Ledkov wrote:
> > @@ -1,3 +1,20 @@
> > +sysvinit (2.88dsf-41ubuntu13) UNRELEASED; urgency=medium
> > +
> > + * Revert previous upload, but keep UPSTARTDIR defined which was still
> > + used in the fallback codepath to specifically prevent configuration
> > + issues in chroots.
>
> What is the reason for this revert, which seems to me to be unrelated to the
> rest of the changes? This seems like a lot of fuss for handling of upstart
> jobs in a chroot, for which the right answer is almost always "install a
> policy-rc.d that blocks all services from starting". Do we have a consensus
> on what the right behavior is here if the host upstart does not support
> chroot sessions, and no policy-rc.d is in place? Should invoke-rc.d error
> out, or should it fall back to starting via the init script, which seem to
> be the two options we're flipping between here?
>

Basically 2.88dsf-41ubuntu11 undefined UPSTARTDIR variable, yet it was still in use

285 if [ ! -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]; then
286 # If the init script doesn't exist, but the upstart job does, we
287 # defer the error exit; we might be running in a chroot and
288 # policy-rc.d might say not to start the job anyway, in which case
289 # we don't want to exit non-zero.
290 exit 100
291 fi

Thus 2.88dsf-41ubuntu12 revert was uploaded to resolve the regression as soon as possible (it was already in utopic release pocket).

I guess to be more clear this portion of the commit could be:

-UPSTARTDIR=/etc/init/

- && [ -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]
+ && initctl status ${INITSCRIPTID} 1>/dev/null 2>/dev/null

- if [ ! -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]; then
+ if [ ! -e "/etc/init/${INITSCRIPTID}.conf" ]; then

Or I can upload it separately.

> > === modified file 'debian/control'
> > --- debian/control 2013-05-17 06:03:10 +0000
> > +++ debian/control 2014-05-19 09:06:30 +0000
> > @@ -43,7 +43,8 @@
> > Depends:
> > ${misc:Depends},
> > sysvinit-utils (>= 2.86.ds1-62),
> > - insserv (>> 1.12.0-10)
> > + insserv (>> 1.12.0-10),
> > + initscripts (>= ${binary:Version})
> > Breaks: initscripts (<< 2.86.ds1-63)
> > Multi-Arch: foreign
> > Description: System-V-like runlevel change mechanism
>
> I don't understand this dependency addition. Maybe this is meant to be
> initscripts (>= 2.88dsf-41ubuntu13), rather than initscripts (>=
> ${binary:Version}) ?
>

Yes, it's meant to be the first version of initscripts that re-introduces these initscripts. If no other uploads ...

Read more...

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

> On Mon, May 19, 2014 at 09:06:40AM -0000, Dimitri John Ledkov wrote:
> > === modified file 'debian/initscripts.conffiles'
> > --- debian/initscripts.conffiles 2013-05-17 06:03:10 +0000
> > +++ debian/initscripts.conffiles 2014-05-19 09:06:30 +0000
> > @@ -1,6 +1,17 @@
> > +/etc/init.d/bootmisc.sh
> > +/etc/init.d/checkfs.sh
> > +/etc/init.d/checkroot.sh
> > +/etc/init.d/checkroot-bootclean.sh
> > /etc/init.d/halt
> > +/etc/init.d/hostname.sh
>
> Note that there is no /etc/init/hostname.sh.conf job at present, which means
> this change will cause both /etc/init.d/hostname.sh and
> /etc/init/hostname.conf to be run.

My bad, I had locally hostname.sh.conf from when I wrote patch to get it included in debian. Will fix this.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

> On Tue, May 20, 2014 at 06:33:19AM -0000, Martin Pitt wrote:
> > Debian has
> > http://anonscm.debian.org/gitweb/?p=collab-
> maint/sysvinit;a=commitdiff;h=0da7086
> > for this problem on the systemd side. So I guess we need the moral
> > equivalent for upstart?
>
> The use of '.sh' extensions for init scripts is deprecated, and there is a
> small and finite set that need to be handled. Furthermore, mapping these
> job names would need to be done in C for upstart (since it's startpar that
> provides the bridging at boot time), and not all of the .sh init scripts
> could be handled as direct translations due to differences in the job
> lifecycles (services vs. tasks in upstart). So the solution here is just to
> provide the missing /etc/init/hostname.sh.conf wrapper job, to go with the
> other wrapper jobs that mountall is already providing.

My understanding is that in above commit it has to drop .sh suffix, because systemd drops .sh suffix from init-scripts when it inventories them into units. But, I would have expected systemd to also add ".sh" alias to those units & all the systemctl commands to still work with either names...

210. By Dimitri John Ledkov

Revert previous upload, which caused regression due to UPSTARTDIR
variable removal that was still in-use.

211. By Dimitri John Ledkov

Clarify usr/lib/insserv path change.

212. By Dimitri John Ledkov

Finalise initscripts package version that will re-introduce dropped initscripts.

213. By Dimitri John Ledkov

Reduce diff with debian. Drop mount-functions.sh sourcing, not available on ubuntu.

214. By Dimitri John Ledkov

drop touching legacy boot ordering stamp in sysv-rc preinst.

Revision history for this message
Steve Langasek (vorlon) wrote :
Download full text (6.7 KiB)

On Wed, May 21, 2014 at 02:26:50PM -0000, Dimitri John Ledkov wrote:
> Thus 2.88dsf-41ubuntu12 revert was uploaded to resolve the regression as
> soon as possible (it was already in utopic release pocket).

> I guess to be more clear this portion of the commit could be:

> -UPSTARTDIR=/etc/init/

> - && [ -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]
> + && initctl status ${INITSCRIPTID} 1>/dev/null 2>/dev/null

> - if [ ! -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]; then
> + if [ ! -e "/etc/init/${INITSCRIPTID}.conf" ]; then

> Or I can upload it separately.

Fine with me for it to be included, now that I understand.

> > > === modified file 'debian/control'
> > > --- debian/control 2013-05-17 06:03:10 +0000
> > > +++ debian/control 2014-05-19 09:06:30 +0000
> > > @@ -43,7 +43,8 @@
> > > Depends:
> > > ${misc:Depends},
> > > sysvinit-utils (>= 2.86.ds1-62),
> > > - insserv (>> 1.12.0-10)
> > > + insserv (>> 1.12.0-10),
> > > + initscripts (>= ${binary:Version})
> > > Breaks: initscripts (<< 2.86.ds1-63)
> > > Multi-Arch: foreign
> > > Description: System-V-like runlevel change mechanism
> >
> > I don't understand this dependency addition. Maybe this is meant to be
> > initscripts (>= 2.88dsf-41ubuntu13), rather than initscripts (>=
> > ${binary:Version}) ?

> Yes, it's meant to be the first version of initscripts that re-introduces
> these initscripts. If no other uploads happen in the mean time it will
> become 2.88dsf-41ubuntu13.

Ok, please don't forget to change it. :)

> > I notice when diffing against initscripts 2.88dsf-41 that there are some
> > init scripts that have not been re-added:
> >
> > -/etc/init.d/bootlogs
> > -/etc/init.d/motd
> > -/etc/init.d/mtab.sh
> > -/etc/init.d/rmnologin
> >
> > What's different about these?

> I think they are not used on ubuntu, and are irrelevant under upstart or
> systemd boot, and not required to enable insserv.

<snip>

> I don't see a point in introducing those + dummy systemd units symlinking to /dev/null + dummy upstart jobs.

Makes sense, thanks.

> > > === modified file 'debian/initscripts.postinst'
> > > --- debian/initscripts.postinst 2013-05-17 06:03:10 +0000
> > > +++ debian/initscripts.postinst 2014-05-19 09:06:30 +0000
> > > @@ -140,6 +140,39 @@
> > > #
> > > # Links in runlevel S
> > > #
> > > +if [ -x /etc/init.d/mountkernfs.sh ]; then
> > > +update-rc.d mountkernfs.sh start 02 S . >/dev/null || exit $?
> > > +fi

> > <snip>

> > Per
> > <https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1312836/comments/7>,
> > we don't want to reintroduce the calls to update-rc.d until /after/ insserv
> > has been re-enabled and fully vetted (i.e., step 4 - drop the debhelper
> > change that causes update-rc.d to be skipped... this also applies to
> > sysvinit, even though sysvinit doesn't use the debhelper implementation.)

> However sysvinit & these scripts are special. Even with update-rc.d, they
> do nothing =) under systemd they are symlinked to /dev/null & under
> upstart they simply start compat jobs which have no body / processes.

That's only true if you have a versioned dependency on the version of
upstart that introduces the init-funct...

Read more...

Revision history for this message
Martin Pitt (pitti) wrote :

This just merely changes the order and is noise (in debian/initscripts.preinst):

180 + eliminate_conffile "/etc/init.d/mountoverflowtmp"
181 eliminate_conffile "/etc/init.d/rmnologin"
182 eliminate_conffile "/etc/init.d/mtab.sh"
183 - eliminate_conffile "/etc/init.d/mountoverflowtmp"

invoke-rc.d:

1365 if which initctl >/dev/null && initctl version 2>/dev/null | grep -q upstart \
1366 - && [ -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]
1367 + && initctl status ${INITSCRIPTID} 1>/dev/null 2>/dev/null

This changes behaviour in chroots: If the host system is running upstart, the chroot has /etc/init/$INITSCRIPTID.conf, but the host doesn't, then in the current code this would still try and use upstart. With this MP this will then be false as the host upstart doesn't know about a job named ${INITSCRIPTID}. There is a fallback later in the code, we just need to be extra-sure that this is really the behaviour that we want. It might still be safer to just explicitly enumerate all possible locations for an upstart job? (NB, I haven't really understood yet how upstart's chroot support works).

The rest looks fine to me (thanks for your further explanations about the .legacy-bootordering check etc.). Thanks for working on this!

review: Approve
Revision history for this message
Martin Pitt (pitti) wrote :

I built and installed this into a relatively clean utopic VM.

  /rc/rc?.d/ before: http://paste.ubuntu.com/7519546/
  /rc/rc?.d/ after: http://paste.ubuntu.com/7519547/

I can't do the comparison on my workstation as I already ran insserv a few weeks ago manually (without this branch and the init.d scripts added back); I also didn't notice any problems since then.

I did a few reboot and powerdown/boot tests without obvious failures, but it seems prudent to look into the details as many of the scripts' effects are not immediately obvious. I looked at the differences in above pastebins:

= rc[2345].d =

The order changed a bit, but only for scripts which don't depend on each other. insserv tends to sort the scripts without/with fewer dependencies like dns-clean first, which makes sense. rc.local is still correctly the last item.

= rc[06].d =
This looks a bit odd. In the original "legacy" ordering we had

lrwxrwxrwx 1 root root 18 Mej 25 13:20 S20sendsigs -> ../init.d/sendsigs
lrwxrwxrwx 1 root root 17 Mej 25 13:20 S30urandom -> ../init.d/urandom
lrwxrwxrwx 1 root root 22 Mej 25 13:20 S31umountnfs.sh -> ../init.d/umountnfs.sh
lrwxrwxrwx 1 root root 18 Mej 25 13:20 S40umountfs -> ../init.d/umountfs
lrwxrwxrwx 1 root root 20 Mej 25 13:20 S60umountroot -> ../init.d/umountroot
lrwxrwxrwx 1 root root 14 Mej 25 13:20 S90halt -> ../init.d/halt

but these got turned into "K" links like

lrwxrwxrwx 1 root root 20 Mej 26 09:48 K01kerneloops -> ../init.d/kerneloops
lrwxrwxrwx 1 root root 15 Mej 26 09:48 K01rsync -> ../init.d/rsync
lrwxrwxrwx 1 root root 27 Mej 26 09:48 K01speech-dispatcher -> ../init.d/speech
-dispatcher

won't that change the semantics? (being called with "stop" instead of "start", etc.)

= rc1.d =

Looks fine

= rcS.d =

As expected we now have the ~ 11 scripts there which got introduced merely for ordering reason, they should be no-ops. Our 4 original links are still there in a reasonable order.

So we should investigate the S → K change for 0/6, otherwise this looks good.

Revision history for this message
Steve Langasek (vorlon) wrote :

On Mon, May 26, 2014 at 08:09:43AM -0000, Martin Pitt wrote:

> So we should investigate the S → K change for 0/6, otherwise this looks
> good.

This is the expected behavior. All scripts in /etc/rc[06].d were already
called with 'stop' as the argument, regardless of the link name. See this
section of /etc/init.d/rc:

# Is there an rc directory for this new runlevel?
if [ -d /etc/rc$runlevel.d ]
then
        case "$runlevel" in
                0|6)
                        ACTION=stop
                        ;;
                S)
                        ACTION=start
                        ;;
                *)
                        ACTION=start
                        ;;
        esac

[...]

So this is not a behavior change.

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks Steve, Dimitri and I were just reading /etc/init.d/rc etc. to convince ourselves. It's running on my work station as well now. So from my POV I'm fully happy to land this now. Do you still have any reservations about this?

review: Approve
Revision history for this message
Steve Langasek (vorlon) wrote :

My approval is conditional on having these previous comments addressed:

 - verifying that there are no other packages whose init scripts are missing (dropped from Debian) before flipping the switch on insserv
 - versioned dependency on upstart for the init-functions.d hook, or other method to ensure that the restored init scripts are not enabled in /etc/rcS.d in a scenario that would cause them to be run on Ubuntu (even due to a partial upgrade)
 - fixing the versioned dependency to use the real version, not ${binary:Version}

Revision history for this message
Martin Pitt (pitti) wrote :

On Steve's first point I reviewed lp:~upstart-devel/upstart/upstart-jobs. There are 142 init.d scripts which are in sid but not in utopic:

$ for f in `ls sid/etc/init.d/`; do [ -e utopic/etc/init.d/$f ] || echo $f; done

We can also exclude the bunch which this MP adds, leaving us with 130:

$ for f in `ls sid/etc/init.d/`; do [ -e utopic/etc/init.d/$f ] || [ -e /etc/init.d/$f ] || echo $f; done > missing-init.d⎵

The majority of these are from cloud-init, openstack (cinder, neutron, nova, swift, etc.) where we never merged with Debian.

Checking which Ubuntu init.d scripts have dependencies to init.d scripts which are in Debian, but not in Ubuntu:

$ for f in $(< missing-init.d); do echo "=== $f ===="; egrep -ir "(-start|-stop):.*$f" utopic/etc/init.d/; done|less

output: http://paste.ubuntu.com/7520913/

Thus we need to fix some 14 packages/scripts.

Revision history for this message
Martin Pitt (pitti) wrote :

I created bug 1323274 to track the missing init.d scripts.

215. By Dimitri John Ledkov

Add versioned upstart dependency on the lsb-hook

216. By Dimitri John Ledkov

minimise diff

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2014-05-16 10:27:06 +0000
+++ debian/changelog 2014-05-26 13:01:48 +0000
@@ -1,3 +1,25 @@
1sysvinit (2.88dsf-41ubuntu13) UNRELEASED; urgency=medium
2
3 * Revert previous upload, which caused regression due to UPSTARTDIR
4 variable removal that was still in-use.
5 * Reintroduce 11 rcS initd scripts:
6 - all of them source /lib/lsb/init-functions and thus do nothing under
7 upstart, and symlinked to /dev/null under systemd.
8 - adjust initscripts conffiles, postinst and postrm to setup symlinks
9 and clean up appropriately.
10 * Enable insserv (LP: #1312836):
11 - adjust path variable in postinst to find insserv under
12 /usr/lib/insserv due to 200_hide_insserv_on_ubuntu.patch in insserv on
13 ubuntu.
14 - adjust legacy_boot check to examine both rc0.d and rc6.d and the
15 stamp file.
16 - perform conversion and remove flag file
17 - cherrypick patch for update-rc.d to lookup insserv in
18 /usr/lib/insserv and /sbin.
19 - drop touching legacy boot ordering stamp in sysv-rc preinst.
20
21 -- Dimitri John Ledkov <xnox@ubuntu.com> Sun, 18 May 2014 22:10:00 +0100
22
1sysvinit (2.88dsf-41ubuntu12) utopic; urgency=medium23sysvinit (2.88dsf-41ubuntu12) utopic; urgency=medium
224
3 * Revert the invoke-rc.d check for "does this upstart job exist" from25 * Revert the invoke-rc.d check for "does this upstart job exist" from
426
=== modified file 'debian/control'
--- debian/control 2013-05-17 06:03:10 +0000
+++ debian/control 2014-05-26 13:01:48 +0000
@@ -43,7 +43,8 @@
43Depends:43Depends:
44 ${misc:Depends},44 ${misc:Depends},
45 sysvinit-utils (>= 2.86.ds1-62),45 sysvinit-utils (>= 2.86.ds1-62),
46 insserv (>> 1.12.0-10)46 insserv (>> 1.12.0-10),
47 initscripts (>= 2.88dsf-41ubuntu13)
47Breaks: initscripts (<< 2.86.ds1-63)48Breaks: initscripts (<< 2.86.ds1-63)
48Multi-Arch: foreign49Multi-Arch: foreign
49Description: System-V-like runlevel change mechanism50Description: System-V-like runlevel change mechanism
@@ -60,7 +61,7 @@
60 sysvinit-utils (>= 2.86.ds1-64), sysv-rc | file-rc,61 sysvinit-utils (>= 2.86.ds1-64), sysv-rc | file-rc,
61 coreutils (>= 5.93),62 coreutils (>= 5.93),
62 passwd,63 passwd,
63 upstart,64 upstart (>= 1.12.1-0ubuntu6),
64 mountall (>= 2.28)65 mountall (>= 2.28)
65Recommends: psmisc, e2fsprogs66Recommends: psmisc, e2fsprogs
66Conflicts:67Conflicts:
6768
=== modified file 'debian/initscripts.conffiles'
--- debian/initscripts.conffiles 2013-05-17 06:03:10 +0000
+++ debian/initscripts.conffiles 2014-05-26 13:01:48 +0000
@@ -1,6 +1,17 @@
1/etc/init.d/bootmisc.sh
2/etc/init.d/checkfs.sh
3/etc/init.d/checkroot.sh
4/etc/init.d/checkroot-bootclean.sh
1/etc/init.d/halt5/etc/init.d/halt
6/etc/init.d/hostname.sh
2/etc/init.d/killprocs7/etc/init.d/killprocs
3/etc/init.d/ondemand8/etc/init.d/ondemand
9/etc/init.d/mountall.sh
10/etc/init.d/mountall-bootclean.sh
11/etc/init.d/mountnfs.sh
12/etc/init.d/mountnfs-bootclean.sh
13/etc/init.d/mountdevsubfs.sh
14/etc/init.d/mountkernfs.sh
4/etc/init.d/rc.local15/etc/init.d/rc.local
5/etc/init.d/reboot16/etc/init.d/reboot
6/etc/init.d/sendsigs17/etc/init.d/sendsigs
718
=== modified file 'debian/initscripts.postinst'
--- debian/initscripts.postinst 2013-05-17 06:03:10 +0000
+++ debian/initscripts.postinst 2014-05-26 13:01:48 +0000
@@ -112,22 +112,12 @@
112 fi112 fi
113fi113fi
114114
115# In 2.87dsf-4ubuntu2, we begin migrating to Upstart jobs, so all of115# In 2.87dsf-4ubuntu2, we begin migrating to Upstart jobs, remove all
116# these get removed.116# those that got removed and not subsequently re-introduced to enable
117# insserv.
117if dpkg --compare-versions "$PREV_VER" le-nl "2.87dsf-4ubuntu2"118if dpkg --compare-versions "$PREV_VER" le-nl "2.87dsf-4ubuntu2"
118then119then
119 update-rc.d -f hostname.sh remove >/dev/null 2>&1 || :
120 update-rc.d -f mountkernfs.sh remove >/dev/null 2>&1 || :
121 update-rc.d -f mountdevsubfs.sh remove >/dev/null 2>&1 || :
122 update-rc.d -f checkroot.sh remove >/dev/null 2>&1 || :
123 update-rc.d -f mtab.sh remove >/dev/null 2>&1 || :120 update-rc.d -f mtab.sh remove >/dev/null 2>&1 || :
124 update-rc.d -f checkfs.sh remove >/dev/null 2>&1 || :
125 update-rc.d -f mountall.sh remove >/dev/null 2>&1 || :
126 update-rc.d -f mountall-bootclean.sh remove >/dev/null 2>&1 || :
127 update-rc.d -f mountoverflowtmp remove >/dev/null 2>&1 || :
128 update-rc.d -f mountnfs.sh remove >/dev/null 2>&1 || :
129 update-rc.d -f mountnfs-bootclean.sh remove >/dev/null 2>&1 || :
130 update-rc.d -f bootmisc.sh remove >/dev/null 2>&1 || :
131 update-rc.d -f bootlogs remove >/dev/null 2>&1 || :121 update-rc.d -f bootlogs remove >/dev/null 2>&1 || :
132 update-rc.d -f rmnologin remove >/dev/null 2>&1 || :122 update-rc.d -f rmnologin remove >/dev/null 2>&1 || :
133fi123fi
@@ -140,6 +130,39 @@
140#130#
141# Links in runlevel S131# Links in runlevel S
142#132#
133if [ -x /etc/init.d/mountkernfs.sh ]; then
134update-rc.d mountkernfs.sh start 02 S . >/dev/null || exit $?
135fi
136if [ -x /etc/init.d/hostname.sh ]; then
137update-rc.d hostname.sh start 02 S . >/dev/null || exit $?
138fi
139if [ -x /etc/init.d/mountdevsubfs.sh ]; then
140update-rc.d mountdevsubfs.sh start 04 S . >/dev/null || exit $?
141fi
142if [ -x /etc/init.d/checkroot.sh ]; then
143update-rc.d checkroot.sh start 10 S . >/dev/null || exit $?
144fi
145if [ -x /etc/init.d/checkroot-bootclean.sh ]; then
146update-rc.d checkroot-bootclean.sh start 13 S . >/dev/null || exit $?
147fi
148if [ -x /etc/init.d/checkfs.sh ]; then
149update-rc.d checkfs.sh start 30 S . >/dev/null || exit $?
150fi
151if [ -x /etc/init.d/mountall.sh ]; then
152update-rc.d mountall.sh start 35 S . >/dev/null || exit $?
153fi
154if [ -x /etc/init.d/mountall-bootclean.sh ]; then
155update-rc.d mountall-bootclean.sh start 36 S . >/dev/null || exit $?
156fi
157if [ -x /etc/init.d/mountnfs.sh ]; then
158update-rc.d mountnfs.sh start 45 S . >/dev/null || exit $?
159fi
160if [ -x /etc/init.d/mountnfs-bootclean.sh ]; then
161update-rc.d mountnfs-bootclean.sh start 46 S . >/dev/null || exit $?
162fi
163if [ -x /etc/init.d/bootmisc.sh ]; then
164update-rc.d bootmisc.sh start 55 S . >/dev/null || exit $?
165fi
143if [ -x /etc/init.d/urandom ]; then166if [ -x /etc/init.d/urandom ]; then
144update-rc.d urandom start 55 S . start 30 0 6 . >/dev/null || exit $?167update-rc.d urandom start 55 S . start 30 0 6 . >/dev/null || exit $?
145fi168fi
146169
=== modified file 'debian/initscripts.postrm'
--- debian/initscripts.postrm 2013-05-17 06:03:10 +0000
+++ debian/initscripts.postrm 2014-05-26 13:01:48 +0000
@@ -57,6 +57,17 @@
57 update-rc.d reboot remove >/dev/null || exit $?57 update-rc.d reboot remove >/dev/null || exit $?
58 update-rc.d halt remove >/dev/null || exit $?58 update-rc.d halt remove >/dev/null || exit $?
59 update-rc.d urandom remove >/dev/null || exit $?59 update-rc.d urandom remove >/dev/null || exit $?
60 update-rc.d bootmisc.sh remove >/dev/null || exit $?
61 update-rc.d mountnfs-bootclean.sh remove >/dev/null || exit $?
62 update-rc.d mountnfs.sh remove >/dev/null || exit $?
63 update-rc.d mountall-bootclean.sh remove >/dev/null || exit $?
64 update-rc.d mountall.sh remove >/dev/null || exit $?
65 update-rc.d checkfs.sh remove >/dev/null || exit $?
66 update-rc.d checkroot-bootclean.sh remove >/dev/null || exit $?
67 update-rc.d checkroot.sh remove >/dev/null || exit $?
68 update-rc.d mountdevsubfs.sh remove >/dev/null || exit $?
69 update-rc.d hostname.sh remove >/dev/null || exit $?
70 update-rc.d mountkernfs.sh remove >/dev/null || exit $?
6071
61 # Remove /dev/pts and /dev/shm ?72 # Remove /dev/pts and /dev/shm ?
62 ;;73 ;;
6374
=== modified file 'debian/initscripts.preinst'
--- debian/initscripts.preinst 2013-05-17 19:02:36 +0000
+++ debian/initscripts.preinst 2014-05-26 13:01:48 +0000
@@ -153,24 +153,15 @@
153 esac153 esac
154 fi154 fi
155 #155 #
156 # Removed as we switched to Upstart156 # Removed as we switched to Upstart, and didn't reintroduce
157 # them for insserv compatiblity.
157 #158 #
158 if [ "$2" ] && dpkg --compare-versions "$2" lt "2.87dsf-4ubuntu6"; then159 if [ "$2" ] && dpkg --compare-versions "$2" lt "2.87dsf-4ubuntu6"; then
159 eliminate_conffile "/etc/network/if-up.d/mountnfs"160 eliminate_conffile "/etc/network/if-up.d/mountnfs"
160 eliminate_conffile "/etc/init.d/bootlogs"161 eliminate_conffile "/etc/init.d/bootlogs"
161 eliminate_conffile "/etc/init.d/checkfs.sh"
162 eliminate_conffile "/etc/init.d/checkroot.sh"
163 eliminate_conffile "/etc/init.d/mountkernfs.sh"
164 eliminate_conffile "/etc/init.d/hostname.sh"
165 eliminate_conffile "/etc/init.d/bootmisc.sh"
166 eliminate_conffile "/etc/init.d/mountall.sh"
167 eliminate_conffile "/etc/init.d/mountdevsubfs.sh"
168 eliminate_conffile "/etc/init.d/rmnologin"162 eliminate_conffile "/etc/init.d/rmnologin"
169 eliminate_conffile "/etc/init.d/mtab.sh"163 eliminate_conffile "/etc/init.d/mtab.sh"
170 eliminate_conffile "/etc/init.d/mountoverflowtmp"164 eliminate_conffile "/etc/init.d/mountoverflowtmp"
171 eliminate_conffile "/etc/init.d/mountnfs.sh"
172 eliminate_conffile "/etc/init.d/mountnfs-bootclean.sh"
173 eliminate_conffile "/etc/init.d/mountall-bootclean.sh"
174 fi165 fi
175 #166 #
176 # A final straggler from the upstart conversion167 # A final straggler from the upstart conversion
177168
=== added file 'debian/src/initscripts/etc/init.d/bootmisc.sh'
--- debian/src/initscripts/etc/init.d/bootmisc.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/bootmisc.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,61 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: bootmisc
4# Required-Start: $remote_fs
5# Required-Stop:
6# Should-Start: udev
7# Default-Start: S
8# Default-Stop:
9# Short-Description: Miscellaneous things to be done during bootup.
10# Description: Some cleanup. Note, it need to run after mountnfs-bootclean.sh.
11### END INIT INFO
12
13. /lib/lsb/init-functions
14
15PATH=/sbin:/usr/sbin:/bin:/usr/bin
16[ "$DELAYLOGIN" ] || DELAYLOGIN=yes
17. /lib/init/vars.sh
18
19do_start () {
20 #
21 # If login delaying is enabled then create the flag file
22 # which prevents logins before startup is complete
23 #
24 case "$DELAYLOGIN" in
25 Y*|y*)
26 echo "System bootup in progress - please wait" > /var/lib/initscripts/nologin
27 ;;
28 esac
29
30 # Create /var/run/utmp so we can login.
31 : > /var/run/utmp
32 if grep -q ^utmp: /etc/group
33 then
34 chmod 664 /var/run/utmp
35 chgrp utmp /var/run/utmp
36 fi
37
38 # Remove bootclean's flag files.
39 # Don't run bootclean again after this!
40 rm -f /tmp/.clean /run/.clean /run/lock/.clean
41 rm -f /tmp/.tmpfs /run/.tmpfs /run/lock/.tmpfs
42}
43
44case "$1" in
45 start|"")
46 do_start
47 ;;
48 restart|reload|force-reload)
49 echo "Error: argument '$1' not supported" >&2
50 exit 3
51 ;;
52 stop|status)
53 # No-op
54 ;;
55 *)
56 echo "Usage: bootmisc.sh [start|stop]" >&2
57 exit 3
58 ;;
59esac
60
61:
062
=== added file 'debian/src/initscripts/etc/init.d/checkfs.sh'
--- debian/src/initscripts/etc/init.d/checkfs.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/checkfs.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,154 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: checkfs
4# Required-Start: checkroot
5# Required-Stop:
6# Should-Start:
7# Default-Start: S
8# Default-Stop:
9# X-Interactive: true
10# Short-Description: Check all filesystems.
11### END INIT INFO
12
13# Include /usr/bin in path to find on_ac_power if /usr/ is on the root
14# partition.
15PATH=/sbin:/bin:/usr/bin
16FSCK_LOGFILE=/var/log/fsck/checkfs
17[ "$FSCKFIX" ] || FSCKFIX=no
18. /lib/init/vars.sh
19
20. /lib/lsb/init-functions
21. /lib/init/swap-functions.sh
22
23do_start () {
24 # Trap SIGINT so that we can handle user interupt of fsck.
25 trap "" INT
26
27 # See if we're on AC Power. If not, we're not gonna run our
28 # check. If on_ac_power (in /usr/) is unavailable, behave as
29 # before and check all file systems needing it.
30
31# Disabled AC power check until fsck can be told to only check the
32# file system if it is corrupt when running on battery. (bug #526398)
33# if which on_ac_power >/dev/null 2>&1
34# then
35# on_ac_power >/dev/null 2>&1
36# if [ $? -eq 1 ]
37# then
38# [ "$VERBOSE" = no ] || log_success_msg "Running on battery power, so skipping file system check."
39# BAT=yes
40# fi
41# fi
42 BAT=""
43 fscheck="yes"
44
45 if is_fastboot_active
46 then
47 [ "$fscheck" = yes ] && log_warning_msg "Fast boot enabled, so skipping file system check."
48 fscheck=no
49 fi
50
51 #
52 # Check the rest of the file systems.
53 #
54 if [ "$fscheck" = yes ] && [ ! "$BAT" ] && [ "$FSCKTYPES" != "none" ]
55 then
56
57 # Execute swapon command again, in case there are lvm
58 # or md swap partitions. fsck can suck RAM.
59 swaponagain 'lvm and md'
60
61 if [ -f /forcefsck ] || grep -q -s -w -i "forcefsck" /proc/cmdline
62 then
63 force="-f"
64 else
65 force=""
66 fi
67 if [ "$FSCKFIX" = yes ]
68 then
69 fix="-y"
70 else
71 fix="-a"
72 fi
73 spinner="-C"
74 case "$TERM" in
75 dumb|network|unknown|"")
76 spinner=""
77 ;;
78 esac
79 [ "$(uname -m)" = s390x ] && spinner="" # This should go away
80 FSCKTYPES_OPT=""
81 [ "$FSCKTYPES" ] && FSCKTYPES_OPT="-t $FSCKTYPES"
82 handle_failed_fsck() {
83 log_failure_msg "File system check failed.
84A log is being saved in ${FSCK_LOGFILE} if that location is writable.
85Please repair the file system manually."
86 log_warning_msg "A maintenance shell will now be started.
87CONTROL-D will terminate this shell and resume system boot."
88 # Start a single user shell on the console
89 if ! sulogin $CONSOLE
90 then
91 log_failure_msg "Attempt to start maintenance shell failed.
92Continuing with system boot in 5 seconds."
93 sleep 5
94 fi
95 }
96 if [ "$VERBOSE" = no ]
97 then
98 log_action_begin_msg "Checking file systems"
99 logsave -s $FSCK_LOGFILE fsck $spinner -R -A $fix $force $FSCKTYPES_OPT
100 FSCKCODE=$?
101
102 if [ "$FSCKCODE" -eq 32 ]
103 then
104 log_action_end_msg 1 "code $FSCKCODE"
105 log_warning_msg "File system check was interrupted by user"
106 elif [ "$FSCKCODE" -gt 1 ]
107 then
108 log_action_end_msg 1 "code $FSCKCODE"
109 handle_failed_fsck
110 else
111 log_action_end_msg 0
112 fi
113 else
114 if [ "$FSCKTYPES" ]
115 then
116 log_action_msg "Will now check all file systems of types $FSCKTYPES"
117 else
118 log_action_msg "Will now check all file systems"
119 fi
120 logsave -s $FSCK_LOGFILE fsck $spinner -V -R -A $fix $force $FSCKTYPES_OPT
121 FSCKCODE=$?
122 if [ "$FSCKCODE" -eq 32 ]
123 then
124 log_warning_msg "File system check was interrupted by user"
125 elif [ "$FSCKCODE" -gt 1 ]
126 then
127 handle_failed_fsck
128 else
129 log_success_msg "Done checking file systems.
130A log is being saved in ${FSCK_LOGFILE} if that location is writable."
131 fi
132 fi
133 fi
134 rm -f /fastboot /forcefsck 2>/dev/null
135}
136
137case "$1" in
138 start|"")
139 do_start
140 ;;
141 restart|reload|force-reload)
142 echo "Error: argument '$1' not supported" >&2
143 exit 3
144 ;;
145 stop|status)
146 # No-op
147 ;;
148 *)
149 echo "Usage: checkfs.sh [start|stop]" >&2
150 exit 3
151 ;;
152esac
153
154:
0155
=== added file 'debian/src/initscripts/etc/init.d/checkroot-bootclean.sh'
--- debian/src/initscripts/etc/init.d/checkroot-bootclean.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/checkroot-bootclean.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,44 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: checkroot-bootclean
4# Required-Start: checkroot
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# X-Start-Before: bootmisc
9# Short-Description: bootclean after checkroot.
10# Description: Clean temporary filesystems after
11# the root filesystem has been mounted.
12# At this point, directories which may be
13# masked by future mounts may be cleaned.
14### END INIT INFO
15
16. /lib/lsb/init-functions
17. /lib/init/bootclean.sh
18
19case "$1" in
20 start|"")
21 # Clean /tmp, /run and /run/lock. Remove the .clean files to
22 # force initial cleaning. This is intended to allow cleaning
23 # of directories masked by mounts while the system was
24 # previously running, which would otherwise prevent them being
25 # cleaned.
26 rm -f /tmp/.clean /run/.clean /run/lock/.clean
27
28 clean_all
29 exit $?
30 ;;
31 restart|reload|force-reload)
32 echo "Error: argument '$1' not supported" >&2
33 exit 3
34 ;;
35 stop|status)
36 # No-op
37 ;;
38 *)
39 echo "Usage: checkroot-bootclean.sh [start|stop]" >&2
40 exit 3
41 ;;
42esac
43
44:
045
=== added file 'debian/src/initscripts/etc/init.d/checkroot.sh'
--- debian/src/initscripts/etc/init.d/checkroot.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/checkroot.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,364 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: checkroot mtab
4# Required-Start: mountdevsubfs hostname
5# Required-Stop:
6# Should-Start: keymap hwclockfirst hdparm bootlogd
7# Should-stop:
8# Default-Start: S
9# Default-Stop:
10# X-Interactive: true
11# Short-Description: Check to root file system.
12### END INIT INFO
13
14# Include /usr/bin in path to find on_ac_power if /usr/ is on the root
15# partition.
16PATH=/sbin:/bin:/usr/bin
17FSCK_LOGFILE=/var/log/fsck/checkroot
18[ "$FSCKFIX" ] || FSCKFIX=no
19[ "$SULOGIN" ] || SULOGIN=no
20. /lib/init/vars.sh
21
22. /lib/lsb/init-functions
23
24do_start () {
25 # Trap SIGINT so that we can handle user interrupt of fsck.
26 trap "" INT
27
28 #
29 # Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to
30 # be spawned from this script *before anything else* with a timeout,
31 # like sysv does.
32 #
33 [ "$SULOGIN" = yes ] && sulogin -t 30 $CONSOLE
34
35 KERNEL="$(uname -s)"
36 MACHINE="$(uname -m)"
37
38 read_fstab
39
40 #
41 # Activate the swap device(s) in /etc/fstab. This needs to be done
42 # before fsck, since fsck can be quite memory-hungry.
43 #
44 ENABLE_SWAP=no
45 case "$KERNEL" in
46 Linux)
47 if [ "$NOSWAP" = yes ]
48 then
49 [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap as requested via bootoption noswap."
50 ENABLE_SWAP=no
51 else
52 if [ "$swap_on_lv" = yes ]
53 then
54 [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on logical volume."
55 elif [ "$swap_on_file" = yes ]
56 then
57 [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on swapfile."
58 else
59 ENABLE_SWAP=yes
60 fi
61 fi
62 ;;
63 *)
64 ENABLE_SWAP=yes
65 ;;
66 esac
67 if [ "$ENABLE_SWAP" = yes ]
68 then
69 if [ "$VERBOSE" = no ]
70 then
71 log_action_begin_msg "Activating swap"
72 swapon -a -e >/dev/null 2>&1
73 log_action_end_msg $?
74 else
75 log_daemon_msg "Activating swap"
76 swapon -a -v
77 log_end_msg $?
78 fi
79 fi
80
81 #
82 # Does the root device in /etc/fstab match with the actual device ?
83 # If not we try to use the /dev/root alias device, and if that
84 # fails we create a temporary node in /run.
85 #
86 # Do this only on Linux. Neither kFreeBSD nor Hurd have
87 # /dev/root and the device ids used here are specific to
88 # Linux.
89 KERNEL="$(uname)"
90 if [ "$rootcheck" = yes ] && [ "$KERNEL" = Linux ]
91 then
92 ddev="$(mountpoint -qx $rootdev)"
93 rdev="$(mountpoint -d /)"
94 if [ "$ddev" != "$rdev" ] && [ "$ddev" != "4:0" ]
95 then
96 if [ "$(mountpoint -qx /dev/root)" = "4:0" ]
97 then
98 rootdev=/dev/root
99 else
100 if \
101 rm -f /run/rootdev \
102 && mknod -m 600 /run/rootdev b ${rdev%:*} ${rdev#*:} \
103 && [ -e /run/rootdev ]
104 then
105 rootdev=/run/rootdev
106 else
107 rootfatal=yes
108 fi
109 fi
110 fi
111 fi
112
113 #
114 # Bother, said Pooh.
115 #
116 if [ "$rootfatal" = yes ]
117 then
118 log_failure_msg "The device node $rootdev for the root filesystem is missing or incorrect
119or there is no entry for the root filesystem listed in /etc/fstab.
120The system is also unable to create a temporary node in /run.
121This means you have to fix the problem manually."
122 log_warning_msg "A maintenance shell will now be started.
123CONTROL-D will terminate this shell and restart the system."
124 # Start a single user shell on the console
125 if ! sulogin $CONSOLE
126 then
127 log_failure_msg "Attempt to start maintenance shell failed.
128Will restart in 5 seconds."
129 sleep 5
130 fi
131 [ "$VERBOSE" = no ] || log_action_msg "Will now restart"
132 reboot -f
133 fi
134
135 # See if we're on AC Power. If not, we're not gonna run our
136 # check. If on_ac_power (in /usr/) is unavailable, behave as
137 # before and check all file systems needing it.
138# Disabled AC power check until fsck can be told to only check the
139# file system if it is corrupt when running on battery. (bug #526398)
140# if which on_ac_power >/dev/null 2>&1 && [ "$rootcheck" = yes ]
141# then
142# on_ac_power >/dev/null 2>&1
143# if [ "$?" -eq 1 ]
144# then
145# log_warning_msg "On battery power, so skipping file system check."
146# rootcheck=no
147# fi
148# fi
149
150 #
151 # See if we want to check the root file system.
152 #
153 FSCKCODE=0
154 if is_fastboot_active
155 then
156 [ "$rootcheck" = yes ] && log_warning_msg "Fast boot enabled, so skipping root file system check."
157 rootcheck=no
158 fi
159
160 if which findmnt >/dev/null 2>&1
161 then
162 if [ "$(findmnt -f -n -o FSTYPE /)" = "btrfs" ]
163 then
164 [ "$rootcheck" = yes ] && log_warning_msg "btrfs root detected, so skipping root file system check."
165 rootcheck=no
166 fi
167 fi
168
169 if [ "$rootcheck" = yes ]
170 then
171 #
172 # Ensure that root is quiescent and read-only before fsck'ing.
173 #
174 # mount -n -o remount,ro / would be the correct syntax but
175 # mount can get confused when there is a "bind" mount defined
176 # in fstab that bind-mounts "/" somewhere else.
177 #
178 # So we use mount -n -o remount,ro $rootdev / but that can
179 # fail on older kernels on sparc64/alpha architectures due
180 # to a bug in sys_mount().
181 #
182 # As a compromise we try both.
183 #
184 if \
185 ! mount -n -o remount,ro $rootdev / \
186 && ! mount -n -o remount,ro -t dummytype $rootdev / 2>/dev/null \
187 && ! mount -n -o remount,ro / 2>/dev/null
188 then
189 log_failure_msg "Cannot check root file system because it is not mounted read-only."
190 rootcheck=no
191 fi
192 fi
193
194 #
195 # The actual checking is done here.
196 #
197 if [ "$rootcheck" = yes ]
198 then
199 if [ -f /forcefsck ] || grep -q -s -w -i "forcefsck" /proc/cmdline
200 then
201 force="-f"
202 else
203 force=""
204 fi
205
206 if [ "$FSCKFIX" = yes ]
207 then
208 fix="-y"
209 else
210 fix="-a"
211 fi
212
213 spinner="-C"
214 case "$TERM" in
215 dumb|network|unknown|"")
216 spinner="" ;;
217 esac
218 # This Linux/s390x special case should go away.
219 if [ "${KERNEL}:${MACHINE}" = Linux:s390x ]
220 then
221 spinner=""
222 fi
223
224 if [ "$VERBOSE" = no ]
225 then
226 log_action_begin_msg "Checking root file system"
227 logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -t $roottype $rootdev
228 FSCKCODE=$?
229 if [ "$FSCKCODE" = 0 ]
230 then
231 log_action_end_msg 0
232 else
233 log_action_end_msg 1 "code $FSCKCODE"
234 fi
235 else
236 log_daemon_msg "Will now check root file system"
237 logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -V -t $roottype $rootdev
238 FSCKCODE=$?
239 log_end_msg $FSCKCODE
240 fi
241 fi
242
243 #
244 # If there was a failure, drop into single-user mode.
245 #
246 # NOTE: "failure" is defined as exiting with a return code of
247 # 4 or larger. A return code of 1 indicates that file system
248 # errors were corrected but that the boot may proceed. A return
249 # code of 2 or 3 indicates that the system should immediately reboot.
250 #
251 if [ "$FSCKCODE" -eq 32 ]
252 then
253 log_warning_msg "File system check was interrupted by user"
254 elif [ "$FSCKCODE" -gt 3 ]
255 then
256 # Surprise! Re-directing from a HERE document (as in "cat << EOF")
257 # does not work because the root is currently read-only.
258 log_failure_msg "An automatic file system check (fsck) of the root filesystem failed.
259A manual fsck must be performed, then the system restarted.
260The fsck should be performed in maintenance mode with the
261root filesystem mounted in read-only mode."
262 log_warning_msg "The root filesystem is currently mounted in read-only mode.
263A maintenance shell will now be started.
264After performing system maintenance, press CONTROL-D
265to terminate the maintenance shell and restart the system."
266 # Start a single user shell on the console
267 if ! sulogin $CONSOLE
268 then
269 log_failure_msg "Attempt to start maintenance shell failed.
270Will restart in 5 seconds."
271 sleep 5
272 fi
273 [ "$VERBOSE" = no ] || log_action_msg "Will now restart"
274 reboot -f
275 elif [ "$FSCKCODE" -gt 1 ]
276 then
277 log_failure_msg "The file system check corrected errors on the root partition
278but requested that the system be restarted."
279 log_warning_msg "The system will be restarted in 5 seconds."
280 sleep 5
281 [ "$VERBOSE" = no ] || log_action_msg "Will now restart"
282 reboot -f
283 fi
284
285 #
286 # Remount root to final mode (rw or ro).
287 #
288 # See the comments above at the previous "mount -o remount"
289 # for an explanation why we try this twice.
290 #
291 if ! mount -n -o remount,$rootopts,$rootmode $fstabroot / 2>/dev/null
292 then
293 mount -n -o remount,$rootopts,$rootmode /
294 fi
295
296 # If possible, migrate /etc/mtab to be a symlink to
297 # /proc/mounts. Note that not all systems e.g. Hurd currently
298 # support this.
299 if [ "$rootmode" != "ro" ]; then
300 mtab_migrate
301 fi
302
303 if selinux_enabled && [ -x /sbin/restorecon ] && [ -r /etc/mtab ]
304 then
305 restorecon /etc/mtab
306 fi
307
308 #
309 # Remove /run/rootdev if we created it.
310 #
311 rm -f /run/rootdev
312
313 # Update mount options for mounts created in early boot
314 # S01mountkernfs.sh
315 /etc/init.d/mountkernfs.sh reload
316 # S03mountdevsubfs.sh
317 /etc/init.d/mountdevsubfs.sh reload
318
319}
320
321do_status () {
322 # If / is read-write or swap is enabled, this script have done
323 # its job.
324 rootrw=false
325 swapon=false
326 if [ -f /etc/mtab ] ; then
327 if grep " / " /etc/mtab |grep -q rw ; then
328 rootrw=true
329 fi
330 fi
331 if [ -f /proc/swaps ] ; then
332 if [ "$(cat /proc/swaps |grep -v ^Filename)" ] ; then
333 swapon=true
334 fi
335 fi
336 if [ true = "$rootrw" ] || [ true = "$swapon" ] ; then
337 return 0
338 else
339 return 4
340 fi
341}
342
343case "$1" in
344 start|"")
345 do_start
346 ;;
347 restart|reload|force-reload)
348 echo "Error: argument '$1' not supported" >&2
349 exit 3
350 ;;
351 stop)
352 # No-op
353 ;;
354 status)
355 do_status
356 exit $?
357 ;;
358 *)
359 echo "Usage: checkroot.sh [start|stop]" >&2
360 exit 3
361 ;;
362esac
363
364:
0365
=== added file 'debian/src/initscripts/etc/init.d/hostname.sh'
--- debian/src/initscripts/etc/init.d/hostname.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/hostname.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,68 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: hostname
4# Required-Start:
5# Required-Stop:
6# Should-Start: glibc
7# Default-Start: S
8# Default-Stop:
9# Short-Description: Set hostname based on /etc/hostname
10# Description: Read the machines hostname from /etc/hostname, and
11# update the kernel value with this value. If
12# /etc/hostname is empty, the current kernel value
13# for hostname is used. If the kernel value is
14# empty, the value 'localhost' is used.
15### END INIT INFO
16
17PATH=/sbin:/bin
18
19. /lib/init/vars.sh
20. /lib/lsb/init-functions
21
22do_start () {
23 [ -f /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)"
24
25 # Keep current name if /etc/hostname is missing.
26 [ -z "$HOSTNAME" ] && HOSTNAME="$(hostname)"
27
28 # And set it to 'localhost' if no setting was found
29 [ -z "$HOSTNAME" ] && HOSTNAME=localhost
30
31 [ "$VERBOSE" != no ] && log_action_begin_msg "Setting hostname to '$HOSTNAME'"
32 hostname "$HOSTNAME"
33 ES=$?
34 [ "$VERBOSE" != no ] && log_action_end_msg $ES
35 exit $ES
36}
37
38do_status () {
39 HOSTNAME=$(hostname)
40 if [ "$HOSTNAME" ] ; then
41 return 0
42 else
43 return 4
44 fi
45}
46
47case "$1" in
48 start|"")
49 do_start
50 ;;
51 restart|reload|force-reload)
52 echo "Error: argument '$1' not supported" >&2
53 exit 3
54 ;;
55 stop)
56 # No-op
57 ;;
58 status)
59 do_status
60 exit $?
61 ;;
62 *)
63 echo "Usage: hostname.sh [start|stop]" >&2
64 exit 3
65 ;;
66esac
67
68:
069
=== added file 'debian/src/initscripts/etc/init.d/mountall-bootclean.sh'
--- debian/src/initscripts/etc/init.d/mountall-bootclean.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/mountall-bootclean.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,37 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: mountall-bootclean
4# Required-Start: mountall
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# X-Start-Before: bootmisc
9# Short-Description: bootclean after mountall.
10# Description: Clean temporary filesystems after
11# all local filesystems have been mounted.
12### END INIT INFO
13
14. /lib/lsb/init-functions
15
16. /lib/init/bootclean.sh
17
18case "$1" in
19 start|"")
20 # Clean /tmp, /var/lock, /var/run
21 clean_all
22 exit $?
23 ;;
24 restart|reload|force-reload)
25 echo "Error: argument '$1' not supported" >&2
26 exit 3
27 ;;
28 stop|status)
29 # No-op
30 ;;
31 *)
32 echo "Usage: mountall-bootclean.sh [start|stop]" >&2
33 exit 3
34 ;;
35esac
36
37:
038
=== added file 'debian/src/initscripts/etc/init.d/mountall.sh'
--- debian/src/initscripts/etc/init.d/mountall.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/mountall.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,94 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: mountall
4# Required-Start: checkfs checkroot-bootclean
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# Short-Description: Mount all filesystems.
9# Description:
10### END INIT INFO
11
12PATH=/sbin:/bin
13. /lib/init/vars.sh
14. /lib/init/tmpfs.sh
15
16. /lib/lsb/init-functions
17. /lib/init/swap-functions.sh
18
19# for ntfs-3g to get correct file name encoding
20if [ -r /etc/default/locale ]; then
21 . /etc/default/locale
22 export LANG
23fi
24
25do_start() {
26 #
27 # Mount local file systems in /etc/fstab.
28 #
29 mount_all_local() {
30 mount -a -t nonfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs,gfs2,ceph \
31 -O no_netdev
32 }
33 pre_mountall
34 if [ "$VERBOSE" = no ]
35 then
36 log_action_begin_msg "Mounting local filesystems"
37 mount_all_local
38 log_action_end_msg $?
39 else
40 log_daemon_msg "Will now mount local filesystems"
41 mount_all_local
42 log_end_msg $?
43 fi
44 post_mountall
45
46 # We might have mounted something over /run; see if
47 # /run/initctl is present. Look for
48 # /usr/share/sysvinit/update-rc.d to verify that sysvinit (and
49 # not upstart) is installed).
50 INITCTL="/run/initctl"
51 if [ ! -p "$INITCTL" ] && [ -f "/usr/share/sysvinit/update-rc.d" ]; then
52 # Create new control channel
53 rm -f "$INITCTL"
54 mknod -m 600 "$INITCTL" p
55
56 # Reopen control channel.
57 PID="$(pidof -s /sbin/init || echo 1)"
58 [ -n "$PID" ] && kill -s USR1 "$PID"
59 fi
60
61 # Execute swapon command again, in case we want to swap to
62 # a file on a now mounted filesystem.
63 swaponagain 'swapfile'
64
65 # Remount tmpfs filesystems; with increased VM after swapon,
66 # the size limits may be adjusted.
67 mount_run mount_noupdate
68 mount_lock mount_noupdate
69 mount_shm mount_noupdate
70
71 # Now we have mounted everything, check whether we need to
72 # mount a tmpfs on /tmp. We can now also determine swap size
73 # to factor this into our size limit.
74 mount_tmp mount_noupdate
75}
76
77case "$1" in
78 start|"")
79 do_start
80 ;;
81 restart|reload|force-reload)
82 echo "Error: argument '$1' not supported" >&2
83 exit 3
84 ;;
85 stop|status)
86 # No-op
87 ;;
88 *)
89 echo "Usage: mountall.sh [start|stop]" >&2
90 exit 3
91 ;;
92esac
93
94:
095
=== added file 'debian/src/initscripts/etc/init.d/mountdevsubfs.sh'
--- debian/src/initscripts/etc/init.d/mountdevsubfs.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/mountdevsubfs.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,67 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: mountdevsubfs
4# Required-Start: mountkernfs
5# Required-Stop:
6# Should-Start: udev
7# Default-Start: S
8# Default-Stop:
9# Short-Description: Mount special file systems under /dev.
10# Description: Mount the virtual filesystems the kernel provides
11# that ordinarily live under the /dev filesystem.
12### END INIT INFO
13#
14# This script gets called multiple times during boot
15#
16
17PATH=/sbin:/bin
18TTYGRP=5
19TTYMODE=620
20[ -f /etc/default/devpts ] && . /etc/default/devpts
21
22KERNEL="$(uname -s)"
23
24. /lib/init/vars.sh
25. /lib/init/tmpfs.sh
26
27. /lib/lsb/init-functions
28
29# May be run several times, so must be idempotent.
30# $1: Mount mode, to allow for remounting
31mount_filesystems () {
32 MNTMODE="$1"
33
34 # Mount a tmpfs on /run/shm
35 mount_shm "$MNTMODE"
36
37 # Mount /dev/pts
38 if [ "$KERNEL" = Linux ]
39 then
40 if [ ! -d /dev/pts ]
41 then
42 mkdir --mode=755 /dev/pts
43 [ -x /sbin/restorecon ] && /sbin/restorecon /dev/pts
44 fi
45 domount "$MNTMODE" devpts "" /dev/pts devpts "-onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE"
46 fi
47}
48
49case "$1" in
50 "")
51 echo "Warning: mountdevsubfs should be called with the 'start' argument." >&2
52 mount_filesystems mount_noupdate
53 ;;
54 start)
55 mount_filesystems mount_noupdate
56 ;;
57 restart|reload|force-reload)
58 mount_filesystems remount
59 ;;
60 stop|status)
61 # No-op
62 ;;
63 *)
64 echo "Usage: mountdevsubfs [start|stop]" >&2
65 exit 3
66 ;;
67esac
068
=== added file 'debian/src/initscripts/etc/init.d/mountkernfs.sh'
--- debian/src/initscripts/etc/init.d/mountkernfs.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/mountkernfs.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,74 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: mountkernfs
4# Required-Start:
5# Required-Stop:
6# Should-Start: glibc
7# Default-Start: S
8# Default-Stop:
9# Short-Description: Mount kernel virtual file systems.
10# Description: Mount initial set of virtual filesystems the kernel
11# provides and that are required by everything.
12### END INIT INFO
13
14PATH=/sbin:/bin
15. /lib/init/vars.sh
16. /lib/init/tmpfs.sh
17
18. /lib/lsb/init-functions
19
20# May be run several times, so must be idempotent.
21# $1: Mount mode, to allow for remounting
22mount_filesystems () {
23 MNTMODE="$1"
24
25 #
26 # Mount tmpfs on /run and/or /run/lock
27 #
28 mount_run "$MNTMODE"
29 mount_lock "$MNTMODE"
30
31 #
32 # Mount proc filesystem on /proc
33 #
34 domount "$MNTMODE" proc "" /proc proc "-onodev,noexec,nosuid"
35
36 #
37 # Mount sysfs on /sys
38 #
39 # Only mount sysfs if it is supported (kernel >= 2.6)
40 if grep -E -qs "sysfs\$" /proc/filesystems
41 then
42 domount "$MNTMODE" sysfs "" /sys sysfs "-onodev,noexec,nosuid"
43 fi
44
45 if [ -d /sys/fs/pstore ]
46 then
47 domount "$MNTMODE" pstore "" /sys/fs/pstore pstore ""
48 fi
49
50 if [ -d /sys/kernel/config ]
51 then
52 domount "$MNTMODE" configfs "" /sys/kernel/config configfs ""
53 fi
54}
55
56case "$1" in
57 "")
58 echo "Warning: mountkernfs should be called with the 'start' argument." >&2
59 mount_filesystems mount_noupdate
60 ;;
61 start)
62 mount_filesystems mount_noupdate
63 ;;
64 restart|reload|force-reload)
65 mount_filesystems remount
66 ;;
67 stop|status)
68 # No-op
69 ;;
70 *)
71 echo "Usage: mountkernfs [start|stop]" >&2
72 exit 3
73 ;;
74esac
075
=== added file 'debian/src/initscripts/etc/init.d/mountnfs-bootclean.sh'
--- debian/src/initscripts/etc/init.d/mountnfs-bootclean.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/mountnfs-bootclean.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,37 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: mountnfs-bootclean
4# Required-Start: $local_fs mountnfs
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# X-Start-Before: bootmisc
9# Short-Description: bootclean after mountnfs.
10# Description: Clean temporary filesystems after
11# network filesystems have been mounted.
12### END INIT INFO
13
14. /lib/lsb/init-functions
15
16. /lib/init/bootclean.sh
17
18case "$1" in
19 start|"")
20 # Clean /tmp, /var/lock, /var/run
21 clean_all
22 exit $?
23 ;;
24 restart|reload|force-reload)
25 echo "Error: argument '$1' not supported" >&2
26 exit 3
27 ;;
28 stop|status)
29 # No-op
30 ;;
31 *)
32 echo "Usage: mountnfs-bootclean.sh [start|stop]" >&2
33 exit 3
34 ;;
35esac
36
37:
038
=== added file 'debian/src/initscripts/etc/init.d/mountnfs.sh'
--- debian/src/initscripts/etc/init.d/mountnfs.sh 1970-01-01 00:00:00 +0000
+++ debian/src/initscripts/etc/init.d/mountnfs.sh 2014-05-26 13:01:48 +0000
@@ -0,0 +1,105 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: mountnfs
4# Required-Start: $local_fs
5# Required-Stop:
6# Should-Start: $network $portmap nfs-common udev-mtab
7# Default-Start: S
8# Default-Stop:
9# Short-Description: Wait for network file systems to be mounted
10# Description: Network file systems are mounted by
11# /etc/network/if-up.d/mountnfs in the background
12# when interfaces are brought up; this script waits
13# for them to be mounted before carrying on.
14### END INIT INFO
15
16. /lib/init/vars.sh
17. /lib/lsb/init-functions
18
19do_wait_async_mount() {
20 # Read through fstab line by line. If it is NFS, set the flag
21 # for mounting NFS file systems. If any NFS partition is found
22 # then wait around for it.
23
24 waitnfs=
25 for file in "$(eval ls $(fstab_files))"; do
26 if [ -f "$file" ]; then
27 while read DEV MTPT FSTYPE OPTS REST; do
28 case "$DEV" in
29 ""|\#*)
30 continue
31 ;;
32 esac
33 case "$OPTS" in
34 noauto|*,noauto|noauto,*|*,noauto,*)
35 continue
36 ;;
37 esac
38 case "$FSTYPE" in
39 nfs|nfs4|smbfs|cifs|coda|ncp|ncpfs|ocfs2|gfs|ceph)
40 ;;
41 *)
42 continue
43 ;;
44 esac
45 case "$MTPT" in
46 /usr/local|/usr/local/*)
47 ;;
48 /usr|/usr/*)
49 waitnfs="$waitnfs $MTPT"
50 ;;
51 /var|/var/*)
52 waitnfs="$waitnfs $MTPT"
53 ;;
54 esac
55 done < "$file"
56 fi
57 done
58
59 # Wait for each path, the timeout is for all of them as that's
60 # really the maximum time we have to wait anyway
61 TIMEOUT=900
62 for mountpt in $waitnfs; do
63 log_action_begin_msg "Waiting for $mountpt"
64
65 while ! mountpoint -q $mountpt; do
66 sleep 0.1
67
68 TIMEOUT=$(( $TIMEOUT - 1 ))
69 if [ $TIMEOUT -le 0 ]; then
70 log_action_end_msg 1
71 break
72 fi
73 done
74
75 if [ $TIMEOUT -gt 0 ]; then
76 log_action_end_msg 0
77 fi
78 done
79}
80
81case "$1" in
82 start)
83 # Using 'no !=' instead of 'yes =' to make sure async nfs
84 # mounting is the default even without a value in
85 # /etc/default/rcS
86 if [ no != "$ASYNCMOUNTNFS" ] ; then
87 do_wait_async_mount
88 else
89 FROMINITD=yes /etc/network/if-up.d/mountnfs
90 fi
91 ;;
92 restart|reload|force-reload)
93 echo "Error: argument '$1' not supported" >&2
94 exit 3
95 ;;
96 stop|status)
97 # No-op
98 ;;
99 *)
100 echo "Usage: $0 start|stop" >&2
101 exit 3
102 ;;
103esac
104
105:
0106
=== modified file 'debian/src/sysv-rc/sbin/invoke-rc.d'
--- debian/src/sysv-rc/sbin/invoke-rc.d 2014-05-16 10:27:06 +0000
+++ debian/src/sysv-rc/sbin/invoke-rc.d 2014-05-26 13:01:48 +0000
@@ -24,7 +24,6 @@
24RUNLEVELHELPER=/sbin/runlevel24RUNLEVELHELPER=/sbin/runlevel
25POLICYHELPER=/usr/sbin/policy-rc.d25POLICYHELPER=/usr/sbin/policy-rc.d
26INITDPREFIX=/etc/init.d/26INITDPREFIX=/etc/init.d/
27UPSTARTDIR=/etc/init/
28RCDPREFIX=/etc/rc27RCDPREFIX=/etc/rc
2928
30# Options29# Options
@@ -273,7 +272,7 @@
273# If we're running on upstart and there's an upstart job of this name, do272# If we're running on upstart and there's an upstart job of this name, do
274# the rest with upstart instead of calling the init script.273# the rest with upstart instead of calling the init script.
275if which initctl >/dev/null && initctl version 2>/dev/null | grep -q upstart \274if which initctl >/dev/null && initctl version 2>/dev/null | grep -q upstart \
276 && [ -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]275 && initctl status ${INITSCRIPTID} 1>/dev/null 2>/dev/null
277then276then
278 is_upstart=1277 is_upstart=1
279elif test -d /run/systemd/system ; then278elif test -d /run/systemd/system ; then
@@ -283,7 +282,7 @@
283 ## Verifies if the given initscript ID is known282 ## Verifies if the given initscript ID is known
284 ## For sysvinit, this error is critical283 ## For sysvinit, this error is critical
285 printerror unknown initscript, ${INITDPREFIX}${INITSCRIPTID} not found.284 printerror unknown initscript, ${INITDPREFIX}${INITSCRIPTID} not found.
286 if [ ! -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]; then285 if [ ! -e "/etc/init/${INITSCRIPTID}.conf" ]; then
287 # If the init script doesn't exist, but the upstart job does, we286 # If the init script doesn't exist, but the upstart job does, we
288 # defer the error exit; we might be running in a chroot and287 # defer the error exit; we might be running in a chroot and
289 # policy-rc.d might say not to start the job anyway, in which case288 # policy-rc.d might say not to start the job anyway, in which case
290289
=== modified file 'debian/src/sysv-rc/sbin/update-rc.d'
--- debian/src/sysv-rc/sbin/update-rc.d 2012-06-30 23:21:06 +0000
+++ debian/src/sysv-rc/sbin/update-rc.d 2014-05-26 13:01:48 +0000
@@ -377,9 +377,12 @@
377377
378 $scriptname = shift @args;378 $scriptname = shift @args;
379 $action = shift @args;379 $action = shift @args;
380 my $insserv = "/usr/lib/insserv/insserv";
381 $insserv = "/sbin/insserv" if ( -x "/sbin/insserv");
380 if ("remove" eq $action) {382 if ("remove" eq $action) {
381 if ( -f "/etc/init.d/$scriptname" ) {383 if ( -f "/etc/init.d/$scriptname" ) {
382 my $rc = system("/sbin/insserv", @opts, "-r", $scriptname) >> 8;384 # Fallback for older insserv package versions [2014-04-16]
385 my $rc = system($insserv, @opts, "-r", $scriptname) >> 8;
383 if (0 == $rc && !$notreally) {386 if (0 == $rc && !$notreally) {
384 remove_last_action($scriptname);387 remove_last_action($scriptname);
385 }388 }
@@ -388,7 +391,7 @@
388 } else {391 } else {
389 # insserv removes all dangling symlinks, no need to tell it392 # insserv removes all dangling symlinks, no need to tell it
390 # what to look for.393 # what to look for.
391 my $rc = system("insserv", @opts) >> 8;394 my $rc = system($insserv, @opts) >> 8;
392 if (0 == $rc && !$notreally) {395 if (0 == $rc && !$notreally) {
393 remove_last_action($scriptname);396 remove_last_action($scriptname);
394 }397 }
@@ -403,7 +406,7 @@
403 cmp_args_with_defaults($scriptname, $action, @args);406 cmp_args_with_defaults($scriptname, $action, @args);
404407
405 if ( -f "/etc/init.d/$scriptname" ) {408 if ( -f "/etc/init.d/$scriptname" ) {
406 my $rc = system("insserv", @opts, $scriptname) >> 8;409 my $rc = system($insserv, @opts, $scriptname) >> 8;
407 if (0 == $rc && !$notreally) {410 if (0 == $rc && !$notreally) {
408 save_last_action($scriptname, @orig_argv);411 save_last_action($scriptname, @orig_argv);
409 }412 }
@@ -415,7 +418,7 @@
415 } elsif ("disable" eq $action || "enable" eq $action) {418 } elsif ("disable" eq $action || "enable" eq $action) {
416 insserv_toggle($notreally, $action, $scriptname, @args);419 insserv_toggle($notreally, $action, $scriptname, @args);
417 # Call insserv to resequence modified links420 # Call insserv to resequence modified links
418 my $rc = system("insserv", @opts, $scriptname) >> 8;421 my $rc = system($insserv, @opts, $scriptname) >> 8;
419 if (0 == $rc && !$notreally) {422 if (0 == $rc && !$notreally) {
420 save_last_action($scriptname, @orig_argv);423 save_last_action($scriptname, @orig_argv);
421 }424 }
422425
=== modified file 'debian/sysv-rc.postinst'
--- debian/sysv-rc.postinst 2013-05-17 06:03:10 +0000
+++ debian/sysv-rc.postinst 2014-05-26 13:01:48 +0000
@@ -7,7 +7,7 @@
7logfile="$logdir/run-$now.log"7logfile="$logdir/run-$now.log"
88
9# Make sure insserv is in path9# Make sure insserv is in path
10PATH=/sbin:$PATH10PATH=/sbin:/usr/lib/insserv/:$PATH
1111
12# Based on code from dash postinst12# Based on code from dash postinst
13check_divert() {13check_divert() {
@@ -41,7 +41,7 @@
41}41}
4242
43legacy_bootordering() {43legacy_bootordering() {
44 for f in /etc/rc0.d/S* ; do44 for f in /etc/rc0.d/S* /etc/rc6.d/S* /etc/init.d/.legacy-bootordering; do
45 if [ -f $f ] ; then45 if [ -f $f ] ; then
46 return 046 return 0
47 fi47 fi
@@ -61,7 +61,7 @@
61 ) > $logfile 2>&1 || return 161 ) > $logfile 2>&1 || return 1
6262
63 # Indicate that system is no longer using the legacy ordering63 # Indicate that system is no longer using the legacy ordering
64 rm $flagfile64 rm -f /etc/init.d/.legacy-bootordering
6565
66 return 066 return 0
67}67}
@@ -74,15 +74,7 @@
74 /usr/sbin/update-rc.d-insserv74 /usr/sbin/update-rc.d-insserv
75 fi75 fi
7676
77# Disabled in Ubuntu until LSB-capable init scripts are restored (via77 if legacy_bootordering ; then
78# debhelper 9.20120909ubuntu2).
79
80# if dpkg --compare-versions "$2" lt "2.88dsf-23"; then
81# rm -f /etc/init.d/.legacy-bootordering
82# fi
83
84# if legacy_bootordering ; then
85 if false; then
86 # Still using legacy ordering, try to convert78 # Still using legacy ordering, try to convert
87 if activate_insserv ; then79 if activate_insserv ; then
88 echo "success: Enabled dependency based boot system." 1>&280 echo "success: Enabled dependency based boot system." 1>&2
8981
=== modified file 'debian/sysv-rc.preinst'
--- debian/sysv-rc.preinst 2013-05-17 06:03:10 +0000
+++ debian/sysv-rc.preinst 2014-05-26 13:01:48 +0000
@@ -15,8 +15,6 @@
15 rm -f /var/lib/update-rc.d/*15 rm -f /var/lib/update-rc.d/*
16 ;;16 ;;
17 install)17 install)
18 # Ubuntu does not use this by default
19 touch /etc/init.d/.legacy-bootordering
20 ;;18 ;;
2119
22 abort-upgrade)20 abort-upgrade)

Subscribers

People subscribed via source and target branches