Merge lp:~racb/ubuntu/oneiric/samba/862129 into lp:ubuntu/oneiric/samba

Proposed by Robie Basak on 2011-10-10
Status: Work in progress
Proposed branch: lp:~racb/ubuntu/oneiric/samba/862129
Merge into: lp:ubuntu/oneiric/samba
Diff against target: 52 lines (+23/-4)
2 files modified
debian/changelog (+7/-0)
debian/samba.postrm (+16/-4)
To merge this branch: bzr merge lp:~racb/ubuntu/oneiric/samba/862129
Reviewer Review Type Date Requested Status
Ubuntu branches 2011-10-10 Pending
Review via email: mp+78862@code.launchpad.net

Description of the change

This fixes my test case in bug 862129.

To post a comment you must log in.
Robie Basak (racb) wrote :

Outstanding questions I posted from that bug that I would like reviewed before merging:

1) Is this the right approach?
2) Is dpkg-query the right way to get the status of the update-inetd package?
3) What about triggers-awaiting and triggers-pending? What should the behaviour be in these cases? Is it OK to treat update-inetd as not available in these cases?

Thanks.

Colin Watson (cjwatson) wrote :

The effect of this change is to make the system non-deterministic. If
we want update-inetd to work from postrm scripts, don't we instead need
to make sure that it always works even if unconfigured, as if it were an
Essential package? This would be much safer and the resulting system
would be easier to understand.

I'm also unconvinced about the reliability of the data returned by
dpkg-query from a maintainer script. It may be better now, but
historically this didn't reliably reflect the state of a running dpkg
instance.

To be honest, I think there are too many questions about this kind of
thing for it to be safe to attempt a fix for this for oneiric. I'd
rather we got it right in precise, and then maybe backported the fix.

Adam Conrad (adconrad) wrote :

It might be worth pointing out that calling update-inetd in a postrm is vaguely crack anyway, as we're removing the service entries AFTER we've removed the binaries from the disk.

Moving the update-inetd call to prerm (where I'd argue it belongs) solves everything we're trying to solve with this complex branch, since the dependencies are still there during prerm.

Robie Basak (racb) wrote :

Thanks Colin and Adam.

I was trying to do the minimal change possible to get the fix into oneiric - as it's causing upgrade failures at the moment. If that's not going to happen, then I'll file a Debian bug as the postrm hasn't been modified by Ubuntu in any way.

Unmerged revisions

148. By Robie Basak on 2011-10-10

debian/samba.postrm: check that update-inetd is configured and in all code
paths. (LP: #862129)

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 2011-09-30 13:08:34 +0000
3+++ debian/changelog 2011-10-10 15:49:26 +0000
4@@ -1,3 +1,10 @@
5+samba (2:3.5.11~dfsg-1ubuntu3) oneiric; urgency=low
6+
7+ * debian/samba.postrm: check that update-inetd is configured and in all code
8+ paths. (LP: #862129)
9+
10+ -- Robie Basak <robie.basak@ubuntu.com> Mon, 10 Oct 2011 15:18:13 +0100
11+
12 samba (2:3.5.11~dfsg-1ubuntu2) oneiric; urgency=low
13
14 * debian/patches/fix-debuglevel-name-conflict.patch:
15
16=== modified file 'debian/samba.postrm'
17--- debian/samba.postrm 2008-11-05 03:24:52 +0000
18+++ debian/samba.postrm 2011-10-10 15:49:26 +0000
19@@ -1,5 +1,19 @@
20 #!/bin/sh -e
21
22+try_update_inetd() {
23+ [ -x /usr/sbin/update-inetd ] || return 0
24+ status=`dpkg-query '-f${Status}' -W update-inetd`
25+ status_f3=`echo "$status"|(read f1 f2 f3 rest;echo $f3)`
26+ case "$status_f3" in
27+ installed)
28+ update-inetd "$@"
29+ ;;
30+
31+ *) echo Skipping update-inetd: not configured >&2
32+ ;;
33+ esac
34+}
35+
36 if [ "$1" = purge ]; then
37 rm -rf /var/cache/samba/browse.dat
38 rm -rf /var/lib/samba/printers/
39@@ -11,12 +25,10 @@
40 rm -f /etc/default/samba
41
42 # Remove NetBIOS entries from /etc/inetd.conf
43- if [ -x /usr/sbin/update-inetd ]; then
44- update-inetd --remove netbios-ssn
45- fi
46+ try_update_inetd --remove netbios-ssn
47 else
48 # Not purging, do not remove NetBIOS entries from /etc/inetd.conf
49- update-inetd --disable netbios-ssn
50+ try_update_inetd --disable netbios-ssn
51
52 fi
53

Subscribers

People subscribed via source and target branches

to all changes: