Merge lp:~xnox/ubiquity/fix-oem-user into lp:ubiquity

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 6029
Proposed branch: lp:~xnox/ubiquity/fix-oem-user
Merge into: lp:ubiquity
Diff against target: 104 lines (+26/-16)
5 files modified
bin/oem-config-firstboot (+12/-0)
bin/oem-config-wrapper (+0/-5)
debian/changelog (+13/-0)
debian/control (+1/-1)
debian/oem-config.oem-config.upstart (+0/-10)
To merge this branch: bzr merge lp:~xnox/ubiquity/fix-oem-user
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+191005@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

* dbus-launch --exit-with session leaves around defunct dbus-launch processes after exiting with session. Later userdel complains that it cannot remove user used by that process. There are no other processes by oem user left, hence using killall -u oem || true, before removing the user. I've tried tracking the pid imperically from the PID that dbus-launch prints on stdout, but that's not the pid that is left around hanging. Not sure if there are any better ways to kill that stray dbus. I guess for T-series we should look into why dbus-launch is leaving defunct process around.

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

I'd prefer using pkill rather than killall on general principles, but this adjustment to my change looks fine to me.

review: Approve
lp:~xnox/ubiquity/fix-oem-user updated
6028. By Dimitri John Ledkov

Use pkill instead, and depend on it

6029. By Dimitri John Ledkov

releasing package ubiquity version 2.15.24

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/oem-config-firstboot'
2--- bin/oem-config-firstboot 2012-10-19 17:03:08 +0000
3+++ bin/oem-config-firstboot 2013-10-14 17:19:43 +0000
4@@ -70,6 +70,14 @@
5 /usr/sbin/oem-config-wrapper $DEBUG $AUTOMATIC --only || CODE=$?
6 fi
7 if [ "$CODE" -eq 0 ]; then
8+ # Remove the temporary OEM configuration user, if possible
9+ # and desired.
10+ RET="$(echo GET oem-config/remove | debconf-communicate)"
11+ if [ "${RET#* }" = true ] && getent passwd oem >/dev/null; then
12+ pkill -u oem || true
13+ userdel --force --remove oem || true
14+ ps -axf
15+ fi
16 exit 0
17 elif [ "$CODE" -eq 10 ]; then
18 cat <<EOF
19@@ -119,6 +127,10 @@
20 rm -f /var/lib/oem-config/run
21 RET="$(echo GET oem-config/remove | debconf-communicate)"
22 if [ "${RET#* }" = true ]; then
23+ if getent passwd oem >/dev/null; then
24+ pkill -u oem || true
25+ userdel --force --remove oem || true
26+ fi
27 apt-get -y purge ubiquity >>/var/log/oem-config.log 2>&1
28 fi
29
30
31=== modified file 'bin/oem-config-wrapper'
32--- bin/oem-config-wrapper 2011-10-01 01:06:43 +0000
33+++ bin/oem-config-wrapper 2013-10-14 17:19:43 +0000
34@@ -9,11 +9,6 @@
35 # Don't run again.
36 rm -f /var/lib/oem-config/run
37
38-# Remove the temporary OEM configuration user, if possible.
39-if getent passwd oem >/dev/null; then
40- userdel --force --remove oem || true
41-fi
42-
43 # Cleanup from anything the early command prepared
44 RET="$(echo GET oem-config/late_command | debconf-communicate)" || true
45 if [ "${RET%% *}" = 0 ]; then
46
47=== modified file 'debian/changelog'
48--- debian/changelog 2013-10-11 14:37:36 +0000
49+++ debian/changelog 2013-10-14 17:19:43 +0000
50@@ -1,3 +1,16 @@
51+ubiquity (2.15.24) saucy; urgency=low
52+
53+ [ Colin Watson ]
54+ * Move oem user removal from upstart & wrapper into
55+ oem-config-firstboot, after ubiquity-dm finished executing. (LP:
56+ #1231166) (LP: #1239471)
57+
58+ [ Dmitrijs Ledkovs ]
59+ * Kill any remaining oem user process before removing oem user (session
60+ dbus leaves zombies). (LP: #1231166)
61+
62+ -- Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> Mon, 14 Oct 2013 18:19:27 +0100
63+
64 ubiquity (2.15.23) saucy; urgency=low
65
66 * Attempt to remove oem user again in the oem-config/post-start, after
67
68=== modified file 'debian/control'
69--- debian/control 2013-09-25 11:56:53 +0000
70+++ debian/control 2013-10-14 17:19:43 +0000
71@@ -81,7 +81,7 @@
72
73 Package: oem-config
74 Architecture: all
75-Depends: ${misc:Depends}, ubiquity (= ${binary:Version}), oem-config-frontend-${mangled-version}
76+Depends: ${misc:Depends}, ubiquity (= ${binary:Version}), oem-config-frontend-${mangled-version}, procps
77 Conflicts: oem-config-keyboard, oem-config-locale, oem-config-timezone
78 Replaces: oem-config-keyboard, oem-config-locale, oem-config-timezone, oem-config-gtk (<< 1.54.13), oem-config-kde (<< 1.54.13)
79 Description: Perform end-user configuration after initial OEM installation
80
81=== modified file 'debian/oem-config.oem-config.upstart'
82--- debian/oem-config.oem-config.upstart 2013-10-11 09:14:15 +0000
83+++ debian/oem-config.oem-config.upstart 2013-10-14 17:19:43 +0000
84@@ -24,8 +24,6 @@
85 task
86 normal exit 0 1
87
88-console output
89-
90 script
91 [ -f /var/lib/oem-config/run ]
92
93@@ -59,11 +57,3 @@
94
95 exec oem-config-firstboot $debug $automatic
96 end script
97-
98-post-start script
99-# Remove the temporary OEM configuration user, again, if possible.
100-# If and when oem-config-wrapper fails http://pad.lv/1231166
101-if getent passwd oem >/dev/null; then
102- userdel --force --remove oem || true
103-fi
104-end script

Subscribers

People subscribed via source and target branches

to status/vote changes: