Merge lp:~xnox/ubuntu/quantal/shadow/clear-locks into lp:ubuntu/quantal/shadow

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 49
Proposed branch: lp:~xnox/ubuntu/quantal/shadow/clear-locks
Merge into: lp:ubuntu/quantal/shadow
Diff against target: 50 lines (+27/-0)
3 files modified
debian/changelog (+7/-0)
debian/passwd.upstart (+18/-0)
debian/rules (+2/-0)
To merge this branch: bzr merge lp:~xnox/ubuntu/quantal/shadow/clear-locks
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+122277@code.launchpad.net

Description of the change

* clear passwd and group locks on bootup.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

Minor suggestions for improvement:

+start on filesystem

I thought about this a couple times, because we know that /etc is always on the root filesystem so we don't need to wait for the whole filesystem to be mounted before doing this. However, this particular job isn't critical-path for booting so it's better to run it later - especially since 'start on mounted MOUNTPOINT=/' would delay mountall from handling other mounts while this job was running.

+script
+ rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock
+end script

Micro-optimisation: this should be 'exec rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock' to avoid spawning a subshell unnecessarily.

review: Approve
49. By Dimitri John Ledkov

Apply uOptimisation from slangasek

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 2012-06-18 15:09:54 +0000
3+++ debian/changelog 2012-09-03 10:13:20 +0000
4@@ -1,3 +1,10 @@
5+shadow (1:4.1.4.2+svn3283-3ubuntu7) quantal; urgency=low
6+
7+ * debian/passwd.upstart: Add an upstrat job to clear locks on
8+ [shadow-]passwd/group. (LP: #523896).
9+
10+ -- Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> Fri, 31 Aug 2012 13:00:33 +0100
11+
12 shadow (1:4.1.4.2+svn3283-3ubuntu6) quantal; urgency=low
13
14 * debian/source_shadow.py: Fix compatibility with python3. Thanks Edward
15
16=== added file 'debian/passwd.upstart'
17--- debian/passwd.upstart 1970-01-01 00:00:00 +0000
18+++ debian/passwd.upstart 2012-09-03 10:13:20 +0000
19@@ -0,0 +1,18 @@
20+# passwd - clear locks on passwd and related files
21+#
22+# Copyright 2012 Canonical Ltd.
23+# Author: Dmitrijs Ledkovs
24+#
25+# This helper clears locks on passwd to avoid million duplicate bug reports
26+# like this one: https://launchpad.net/bugs/523896
27+# Ideally we'd know what lock-up, and doesn't clear the lock, and fix that.
28+# But it appears to be safe enough to clear them unconditionally on boot.
29+#
30+
31+description "Clear passwd locks"
32+
33+start on filesystem
34+
35+task
36+
37+exec rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock
38
39=== modified file 'debian/rules'
40--- debian/rules 2010-11-24 13:42:42 +0000
41+++ debian/rules 2012-09-03 10:13:20 +0000
42@@ -15,6 +15,8 @@
43 # (This is only needed on The Hurd, where only one package is built. On
44 # the other arch, DEB_DESTDIR already points to debian/tmp)
45 DEB_DESTDIR=$(CURDIR)/debian/tmp
46+# Upstart job for clearing locks
47+DEB_DH_INSTALLINIT_ARGS=--upstart-only --no-start
48
49 include /usr/share/cdbs/1/class/autotools.mk
50 # Automatically update autoconf, etc.

Subscribers

People subscribed via source and target branches