summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2013-01-26 00:36:36 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2013-01-26 00:36:36 +0100
commit07f7d82178e2d3ce12480bd56f0c6e6e0bd67dc0 (patch)
tree038e9c8cad51513369037524f21b3c6791fe6309
parenta3d559ac4e87b141de8295a8ea62d4eb747e382c (diff)
downloadnetctl-07f7d82178e2d3ce12480bd56f0c6e6e0bd67dc0.tar.gz
netctl-07f7d82178e2d3ce12480bd56f0c6e6e0bd67dc0.tar.xz
Correctly wait for devices
BindsTo= is not enough, we also need After=.
-rw-r--r--services/netctl-auto@.service1
-rw-r--r--services/netctl-ifplugd@.service1
-rwxr-xr-xsrc/netctl2
3 files changed, 4 insertions, 0 deletions
diff --git a/services/netctl-auto@.service b/services/netctl-auto@.service
index 6894fda..704c039 100644
--- a/services/netctl-auto@.service
+++ b/services/netctl-auto@.service
@@ -2,6 +2,7 @@
Description=Automatic wireless network connection using netctl profiles
Documentation=man:netctl.special(7)
BindsTo=sys-subsystem-net-devices-%i.device
+After=sys-subsystem-net-devices-%i.device
Before=network.target
Wants=network.target
diff --git a/services/netctl-ifplugd@.service b/services/netctl-ifplugd@.service
index dcd9965..bc04512 100644
--- a/services/netctl-ifplugd@.service
+++ b/services/netctl-ifplugd@.service
@@ -2,6 +2,7 @@
Description=Automatic wired network connection using netctl profiles
Documentation=man:netctl.special(7)
BindsTo=sys-subsystem-net-devices-%i.device
+After=sys-subsystem-net-devices-%i.device
[Service]
ExecStart=/usr/bin/ifplugd -i %i -r /etc/ifplugd/netctl.action -bfIns
diff --git a/src/netctl b/src/netctl
index 897f648..eec8501 100755
--- a/src/netctl
+++ b/src/netctl
@@ -91,6 +91,8 @@ unit_enable() {
: ${BindsToInterfaces=$Interface}
printf 'BindsTo=sys-subsystem-net-devices-%s.device\n' \
"${BindsToInterfaces[@]}" >> "$unit"
+ printf 'After=sys-subsystem-net-devices-%s.device\n' \
+ "${BindsToInterfaces[@]}" >> "$unit"
if [[ -n $After ]]; then
printf 'After="netctl@%s.service"\n' "${After[@]//\"/\\\"}" >> "$unit"
fi