Bug#796585: #796585: aoetools: Has init script in runlevel S but no matching service file

2016-07-04 Thread Christian Hofstaedtler
* Christian Hofstaedtler  [160704 20:01]:
> I'm attaching a debdiff of something that -works-, but causes a
> 60sec wait for AoE mount points listed in fstab (with
> defaults,_netdev).

After some additional debugging I found aoe-discover.service starts
too early, just before my network interface has an IP address (from
DHCP). Even with After=network-online.target.

Calling aoe-discover from /etc/network/if-up.d improves this for me
to a "works fine at every other boot" situation.

-- 
 ,''`.  Christian Hofstaedtler 
: :' :  Debian Developer
`. `'   7D1A CFFA D9E0 806C 9C4C  D392 5C13 D6DB 9305 2E03
  `-



Bug#796585: #796585: aoetools: Has init script in runlevel S but no matching service file

2016-07-04 Thread Christian Hofstaedtler
Hi,

I'm attaching a debdiff of something that -works-, but causes a
60sec wait for AoE mount points listed in fstab (with
defaults,_netdev).

I think the wait would go away if aoe-discover would be started
immediately after network.target is up and the aoe kernel module has
been inserted, but unfortunately even with the configured udev rule
and DefaultDependencies=no, aoe-discover.service does not
start early enough in my testing.

Debugging help, hints, etc. would be appreciated.

-- 
 ,''`.  Christian Hofstaedtler 
: :' :  Debian Developer
`. `'   7D1A CFFA D9E0 806C 9C4C  D392 5C13 D6DB 9305 2E03
  `-

diff -Nru aoetools-36/debian/60-aoe.rules aoetools-36/debian/60-aoe.rules
--- aoetools-36/debian/60-aoe.rules 1970-01-01 01:00:00.0 +0100
+++ aoetools-36/debian/60-aoe.rules 2016-07-04 17:05:48.0 +0200
@@ -0,0 +1,11 @@
+# These rules tell udev what device nodes to create for aoe support.
+
+# aoe char devices
+SUBSYSTEM=="aoe", KERNEL=="discover",  NAME="etherd/%k", GROUP="disk", 
MODE="0220"
+SUBSYSTEM=="aoe", KERNEL=="err",   NAME="etherd/%k", GROUP="disk", 
MODE="0440"
+SUBSYSTEM=="aoe", KERNEL=="interfaces",NAME="etherd/%k", GROUP="disk", 
MODE="0220"
+SUBSYSTEM=="aoe", KERNEL=="revalidate",NAME="etherd/%k", GROUP="disk", 
MODE="0220"
+SUBSYSTEM=="aoe", KERNEL=="flush", NAME="etherd/%k", GROUP="disk", 
MODE="0220"
+
+# run discover once the module is loaded
+SUBSYSTEM=="aoe", KERNEL=="discover", ACTION=="add", TAG+="systemd", 
ENV{SYSTEMD_WANTS}+="aoe-discover.service"
diff -Nru aoetools-36/debian/aoetools.aoe-discover.service 
aoetools-36/debian/aoetools.aoe-discover.service
--- aoetools-36/debian/aoetools.aoe-discover.service1970-01-01 
01:00:00.0 +0100
+++ aoetools-36/debian/aoetools.aoe-discover.service2016-07-04 
19:36:57.0 +0200
@@ -0,0 +1,11 @@
+[Unit]
+Description=ATA over Ethernet discovery
+After=network.target
+BindsTo=sys-devices-virtual-aoe-discover.device
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=network.target
+
+[Service]
+Type=oneshot
+ExecStart=/sbin/aoe-discover
diff -Nru aoetools-36/debian/aoetools.default 
aoetools-36/debian/aoetools.default
--- aoetools-36/debian/aoetools.default 2014-01-17 22:21:51.0 +0100
+++ aoetools-36/debian/aoetools.default 2016-07-04 16:16:48.0 +0200
@@ -1,5 +1,9 @@
 # Configuration file for aoetools.
 
+## NOTE: This file is NOT READ under systemd.
+## If you need to restrict the used interfaces, please read 
/usr/lib/modules-load.d/aoetools.conf
+## Filesystems can be mounted using /etc/fstab.
+
 # Enter the list of network interfaces to restrict the AoE discovery to, 
separated by spaces.
 # It can be blank, i.e. "", if you want to run AoE over all the interfaces.
 # If you do not want AoE discovery at all, enter "none" as the list of 
interfaces.
diff -Nru aoetools-36/debian/aoetools.install 
aoetools-36/debian/aoetools.install
--- aoetools-36/debian/aoetools.install 1970-01-01 01:00:00.0 +0100
+++ aoetools-36/debian/aoetools.install 2016-07-04 16:57:08.0 +0200
@@ -0,0 +1,2 @@
+debian/modules-load.d/aoetools.conf /usr/lib/modules-load.d/
+debian/60-aoe.rules /lib/udev/rules.d/
diff -Nru aoetools-36/debian/aoetools.links aoetools-36/debian/aoetools.links
--- aoetools-36/debian/aoetools.links   1970-01-01 01:00:00.0 +0100
+++ aoetools-36/debian/aoetools.links   2016-07-04 16:13:30.0 +0200
@@ -0,0 +1 @@
+dev/null lib/systemd/system/aoetools.service
diff -Nru aoetools-36/debian/aoetools.postinst 
aoetools-36/debian/aoetools.postinst
--- aoetools-36/debian/aoetools.postinst1970-01-01 01:00:00.0 
+0100
+++ aoetools-36/debian/aoetools.postinst2016-07-04 16:51:05.0 
+0200
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+configure)
+if which udevadm >/dev/null; then
+udevadm control --reload || true
+fi
+# load the kernel module (as opposed to letting the init script do it)
+if [ -d /run/systemd/system ] ; then
+/lib/systemd/systemd-modules-load aoetools.conf
+fi
+;;
+abort-upgrade|abort-remove|abort-deconfigure)
+;;
+*)
+echo "postinst called with unknown argument '$1'"
+exit 1
+;;
+esac
+
+#DEBHELPER#
+exit 0
diff -Nru aoetools-36/debian/changelog aoetools-36/debian/changelog
--- aoetools-36/debian/changelog2014-01-17 23:15:21.0 +0100
+++ aoetools-36/debian/changelog2016-07-04 19:31:02.0 +0200
@@ -1,3 +1,10 @@
+aoetools (36-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Install native systemd units. (Closes: #796585)
+
+ -- Christian Hofstaedtler   Mon, 04 Jul 2016 19:29:07 +0200
+
 aoetools (36-1) unstable; urgency=low
 
   * New upstream release, released on 2013-08-07.  Changes since the last one:
diff -Nru aoetools-36/debian/control aoetools-36/debian/control
--- aoetools-36/debian/control  2014-01-15 11:50:14.0 +0100
+++