Merge lp:~vorlon/ubuntu/saucy/sysvinit/lp.1184006 into lp:ubuntu/saucy/sysvinit

Proposed by Steve Langasek
Status: Needs review
Proposed branch: lp:~vorlon/ubuntu/saucy/sysvinit/lp.1184006
Merge into: lp:ubuntu/saucy/sysvinit
Diff against target: 48 lines (+17/-3)
3 files modified
debian/changelog (+7/-0)
debian/initscripts.preinst (+10/-0)
debian/src/initscripts/etc/default/rcS (+0/-3)
To merge this branch: bzr merge lp:~vorlon/ubuntu/saucy/sysvinit/lp.1184006
Reviewer Review Type Date Requested Status
Colin Watson Pending
Review via email: mp+165722@code.launchpad.net

Description of the change

Colin, can you review this to see if it seems sane to you?

It's possible there needs to be a corresponding change to the installer -
dunno if we expose the option to set UTC=no nowadays.

To post a comment you must log in.
191. By Steve Langasek

Merge from trunk, and adjust the version check in the preinst to account for
an intervening upload

Revision history for this message
Colin Watson (cjwatson) wrote :

The general approach more or less makes sense to me, but a few things:

 * Yes, we'll need corresponding changes to the installer; unfortunately
   this is one of the things that's duplicated between d-i and ubiquity,
   so changes need to be in both clock-setup and ubiquity.

 * We'll need to think about upload coordination. You have a version
   guard, but what about the overlap case with a daily build where an
   older installer installs a newer initscripts? That suggests to me
   that you shouldn't write to /etc/init/hwclock.override or
   /etc/init/hwclock-save.override if they already contain UTC settings;
   I think if we changed the installer first to handle either old or
   new, and then changed sysvinit with that refinement, then that would
   work.

 * I don't quite understand what "sed -i -e's/^UTC=.*/UTC=yes/'
   /etc/default/rcS" is for. Is that so that dpkg conffile replacement
   works? Would it be better to forcibly remove the option in the
   postinst, instead or perhaps as well? Editing conffiles is of course
   always a bit scary, so I suppose go with whatever approach
   initscripts has historically taken here ...

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

On Fri, May 31, 2013 at 06:16:26PM -0000, Colin Watson wrote:
> The general approach more or less makes sense to me, but a few things:

> * Yes, we'll need corresponding changes to the installer; unfortunately
> this is one of the things that's duplicated between d-i and ubiquity,
> so changes need to be in both clock-setup and ubiquity.

> * We'll need to think about upload coordination. You have a version
> guard, but what about the overlap case with a daily build where an
> older installer installs a newer initscripts? That suggests to me
> that you shouldn't write to /etc/init/hwclock.override or
> /etc/init/hwclock-save.override if they already contain UTC settings;
> I think if we changed the installer first to handle either old or
> new, and then changed sysvinit with that refinement, then that would
> work.

Ok. Should I prepare the changes to clock-setup and ubiquity?

> * I don't quite understand what "sed -i -e's/^UTC=.*/UTC=yes/'
> /etc/default/rcS" is for. Is that so that dpkg conffile replacement
> works? Would it be better to forcibly remove the option in the
> postinst, instead or perhaps as well? Editing conffiles is of course
> always a bit scary, so I suppose go with whatever approach
> initscripts has historically taken here ...

This is to suppress the wrong conffile replacement prompt, yes, by ensuring
that the copy of the file on disk doesn't have any spurious delta caused by
the UTC setting that we're moving out of the way. I'm confident that this
part of the code is doing the right thing, neither incorrectly losing any
user preferences nor mangling the file in a way that will *cause* conffile
prompts incorrectly on upgrade. (This is a sed to UTC=yes, rather than a
removal, because that ensures it matches the interim version of the conffile
as shipped in the package currently in saucy, giving the correct results for
both pre-saucy and saucy upgrades.)

Revision history for this message
Colin Watson (cjwatson) wrote :

On Fri, May 31, 2013 at 06:28:28PM -0000, Steve Langasek wrote:
> Ok. Should I prepare the changes to clock-setup and ubiquity?

If you could, that would be great. Obviously if you don't have time
then let me know.

> > * I don't quite understand what "sed -i -e's/^UTC=.*/UTC=yes/'
> > /etc/default/rcS" is for. Is that so that dpkg conffile replacement
> > works? Would it be better to forcibly remove the option in the
> > postinst, instead or perhaps as well? Editing conffiles is of course
> > always a bit scary, so I suppose go with whatever approach
> > initscripts has historically taken here ...
>
> This is to suppress the wrong conffile replacement prompt, yes, by ensuring
> that the copy of the file on disk doesn't have any spurious delta caused by
> the UTC setting that we're moving out of the way. I'm confident that this
> part of the code is doing the right thing, neither incorrectly losing any
> user preferences nor mangling the file in a way that will *cause* conffile
> prompts incorrectly on upgrade. (This is a sed to UTC=yes, rather than a
> removal, because that ensures it matches the interim version of the conffile
> as shipped in the package currently in saucy, giving the correct results for
> both pre-saucy and saucy upgrades.)

OK. Most things relating to conffile mangling in maintainer scripts
still give me the shivers, but this seems reasonable enough.

Unmerged revisions

191. By Steve Langasek

Merge from trunk, and adjust the version check in the preinst to account for
an intervening upload

190. By Steve Langasek

Move the UTC setting out of /etc/default/rcS, which is now a conffile,
to /etc/init/hwclock{,-save}.override. LP: #1184006.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-05-28 19:23:46 +0000
3+++ debian/changelog 2013-05-28 19:58:43 +0000
4@@ -1,3 +1,10 @@
5+sysvinit (2.88dsf-41ubuntu3) UNRELEASED; urgency=low
6+
7+ * Move the UTC setting out of /etc/default/rcS, which is now a conffile,
8+ to /etc/init/hwclock{,-save}.override. LP: #1184006.
9+
10+ -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 24 May 2013 16:39:58 -0700
11+
12 sysvinit (2.88dsf-41ubuntu2) saucy; urgency=low
13
14 * debian/src/sysv-rc/sbin/invoke-rc.d: tweak behavior of invoke-rc.d when
15
16=== modified file 'debian/initscripts.preinst'
17--- debian/initscripts.preinst 2013-05-17 19:02:36 +0000
18+++ debian/initscripts.preinst 2013-05-28 19:58:43 +0000
19@@ -60,6 +60,16 @@
20 if [ "$2" ] && dpkg --compare-versions "$2" lt "2.88dsf-23" ; then
21 eliminate_conffile "/etc/init.d/mountoverflowtmp"
22 fi
23+
24+ if dpkg --compare-versions "$2" lt-nl 2.88dsf-41ubuntu3; then
25+ UTC=yes
26+ . /etc/default/rcS
27+ if [ "$UTC" != yes ]; then
28+ echo "env UTC=\"$UTC\"" >> /etc/init/hwclock.override
29+ echo "env UTC=\"$UTC\"" >> /etc/init/hwclock-save.override
30+ fi
31+ sed -i -e's/^UTC=.*/UTC=yes/' /etc/default/rcS
32+ fi
33 # rcS was made a conffile in removed in 2.88dsf-26. Replace
34 # unmodified older versions, including automated commenting of
35 # removed variables.
36
37=== modified file 'debian/src/initscripts/etc/default/rcS'
38--- debian/src/initscripts/etc/default/rcS 2013-05-17 06:03:10 +0000
39+++ debian/src/initscripts/etc/default/rcS 2013-05-28 19:58:43 +0000
40@@ -17,9 +17,6 @@
41 # do not allow users to log in until the boot has completed
42 #DELAYLOGIN=no
43
44-# assume that the BIOS clock is set to UTC time (recommended)
45-UTC=yes
46-
47 # be more verbose during the boot process
48 #VERBOSE=no
49

Subscribers

People subscribed via source and target branches