Hey Cameron, Thomas,

I ran into resolvconf being broken with systemd as when NetworkManager
starts it sees the dangling /etc/resolv.conf symlink and replaces it
with a file. So I looked into this and uploaded a fixed version of
this into my PPA (https://launchpad.net/~pitti/+archive/systemd)

Cameron Norman [2014-04-01  2:27 -0007]:
> [Unit]
> Description=Database for name server runtime information
> Documentation=man:resolvconf(8)
> DefaultDependencies=no
> # Is this right? I want to start when /run is available and
> # stop on shutdown (but not before).
> RequiresMountsFor=/run

Consulting #systemd: This seems redundant as systemd mounts /run
before running any unit. But it doesn't hurt, so I left it in for now.

> RemainAfterExit=yes
> ExecPreStart=/bin/mkdir -p /run/resolvconf/interface; /bin/touch 
> /run/resolvconf/postponed-update

ExecStart* are not shell commands, so this causes some havoc: it
creates a dir "interface;", another dir /bin/touch (which fails), and
the third dir. It's better to write that as two commands.

> ExecStart=/sbin/resolvconf --enable-updates
> ExecStop=/sbin/resolvconf --disable-updates

This is also missing an [Install] section. I recommend network.target,
this will go well together with NM which has
Wants/Before=network.target. So it will wait until /run/resolvconf/ is
set up.

I tested this with some 5 boots and it works well.

Debdiff attached (it's against the slightly older Ubuntu version, but
it should apply fairly well to Debian's package).

Thanks,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
diff -Nru resolvconf-1.69ubuntu1/debian/changelog 
resolvconf-1.69ubuntu1pitti1/debian/changelog
--- resolvconf-1.69ubuntu1/debian/changelog     2013-01-18 17:52:11.000000000 
+0100
+++ resolvconf-1.69ubuntu1pitti1/debian/changelog       2014-04-23 
16:00:39.000000000 +0200
@@ -1,3 +1,9 @@
+resolvconf (1.69ubuntu1pitti1) trusty; urgency=medium
+
+  * Add systemd unit (Closes: #700846)
+
+ -- Martin Pitt <[email protected]>  Wed, 23 Apr 2014 15:56:57 +0200
+
 resolvconf (1.69ubuntu1) raring; urgency=low
 
   * Merge from Debian. Remaining changes: (LP: #1085756)
diff -Nru resolvconf-1.69ubuntu1/debian/control 
resolvconf-1.69ubuntu1pitti1/debian/control
--- resolvconf-1.69ubuntu1/debian/control       2013-01-18 17:28:38.000000000 
+0100
+++ resolvconf-1.69ubuntu1pitti1/debian/control 2014-04-23 15:55:28.000000000 
+0200
@@ -4,7 +4,7 @@
 Maintainer: Ubuntu Developers <[email protected]>
 XSBC-Original-Maintainer: resolvconf maintainers 
<[email protected]>
 Uploaders: Thomas Hood <[email protected]>, Marco Nenciarini 
<[email protected]>
-Build-Depends: debhelper (>= 8)
+Build-Depends: debhelper (>= 8), dh-systemd
 Homepage: http://alioth.debian.org/projects/resolvconf/
 Vcs-Git: git://git.debian.org/git/resolvconf/resolvconf.git
 Vcs-Browser: http://git.debian.org/?p=resolvconf/resolvconf.git
diff -Nru resolvconf-1.69ubuntu1/debian/resolvconf.service 
resolvconf-1.69ubuntu1pitti1/debian/resolvconf.service
--- resolvconf-1.69ubuntu1/debian/resolvconf.service    1970-01-01 
01:00:00.000000000 +0100
+++ resolvconf-1.69ubuntu1pitti1/debian/resolvconf.service      2014-04-23 
15:55:12.000000000 +0200
@@ -0,0 +1,16 @@
+[Unit]
+Description=Nameserver information manager
+Documentation=man:resolvconf(8)
+DefaultDependencies=no
+RequiresMountsFor=/run
+Conflicts=shutdown.target
+
+[Service]
+RemainAfterExit=yes
+ExecStartPre=/bin/mkdir -p /run/resolvconf/interface
+ExecStartPre=/bin/touch /run/resolvconf/postponed-update
+ExecStart=/sbin/resolvconf --enable-updates
+ExecStop=/sbin/resolvconf --disable-updates
+
+[Install]
+WantedBy=network.target
diff -Nru resolvconf-1.69ubuntu1/debian/rules 
resolvconf-1.69ubuntu1pitti1/debian/rules
--- resolvconf-1.69ubuntu1/debian/rules 2012-12-13 19:27:08.000000000 +0100
+++ resolvconf-1.69ubuntu1pitti1/debian/rules   2014-04-23 15:56:33.000000000 
+0200
@@ -35,7 +35,9 @@
        dh_installdocs README
        dh_installman
        dh_installchangelogs
+       dh_systemd_enable
        dh_installinit -r
+       dh_systemd_start -r
        dh_installppp --name=000resolvconf
        dh_installifupdown --name=resolvconf
        dh_installifupdown --name=000resolvconf

Attachment: signature.asc
Description: Digital signature

Reply via email to