Patchwork [wpa_supplicant] Use correct (multi-user) target when installing systemd units.

login
register
mail settings
Submitter Michał Górny
Date Dec. 27, 2011, 10:24 p.m.
Message ID <1325024686-7714-1-git-send-email-mgorny@gentoo.org>
Download mbox | patch
Permalink /patch/133368/
State Accepted
Commit 399ec170e87ca1404c534d31da663ca05fef63ab
Headers show

Comments

Michał Górny - Dec. 27, 2011, 10:24 p.m.
The 'network.target' is special (per systemd.special(7)), and is to be
brought up indirectly when network is actually configured (i.e. through
DHCP or static address settings).

Irrelevant of that, all services should be always installed in
multi-user.target.

Fixes: http://w1.fi/bugz/show_bug.cgi?id=427
---
 .../systemd/wpa_supplicant-nl80211@.service.in     |    2 +-
 .../systemd/wpa_supplicant-wired@.service.in       |    2 +-
 wpa_supplicant/systemd/wpa_supplicant.service.in   |    2 +-
 wpa_supplicant/systemd/wpa_supplicant@.service.in  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Jouni Malinen - Dec. 29, 2011, 7:40 p.m.
On Tue, Dec 27, 2011 at 11:24:46PM +0100, Michał Górny wrote:
> The 'network.target' is special (per systemd.special(7)), and is to be
> brought up indirectly when network is actually configured (i.e. through
> DHCP or static address settings).
> 
> Irrelevant of that, all services should be always installed in
> multi-user.target.

Thanks, applied.
Jouni Malinen - Jan. 18, 2012, 1:37 a.m.
On Tue, Dec 27, 2011 at 11:24:46PM +0100, Michał Górny wrote:
> The 'network.target' is special (per systemd.special(7)), and is to be
> brought up indirectly when network is actually configured (i.e. through
> DHCP or static address settings).
> 
> Irrelevant of that, all services should be always installed in
> multi-user.target.

>  .../systemd/wpa_supplicant-nl80211@.service.in     |    2 +-
>  .../systemd/wpa_supplicant-wired@.service.in       |    2 +-
>  wpa_supplicant/systemd/wpa_supplicant.service.in   |    2 +-
>  wpa_supplicant/systemd/wpa_supplicant@.service.in  |    2 +-

While this commit did not add these files, one thing came up when
handling this change.. It looks like Perforce does not exactly like the
'@' in the file name. Does that have special meaning in systemd or would
it be fine to rename these files? If nothing else, at least the
*.service.in files could be renamed so that '@' is added only when
generating the *.service files.
Holger Schurig - Jan. 18, 2012, 10:31 a.m.
> It looks like Perforce does not exactly like the
> '@' in the file name. Does that have special meaning in systemd or would
> it be fine to rename these files?

Unfortunately for Perforce, the @ in a systemd service file name is
indeed special, it's used to for some kind of template.

If you go to https://wiki.archlinux.org/index.php/Systemd and search
for @ you'll see an example.
Jouni Malinen - Jan. 28, 2012, 3:15 p.m.
On Wed, Jan 18, 2012 at 07:59:29AM +0100, Michał Górny wrote:
> Yes, '@' is necessary to support passing arguments like '@wlan0'. Of
> course, it is possible to change that so @ is used only in final
> filename.

OK, I renamed the template files to avoid issues with Perforce.

Patch

diff --git a/wpa_supplicant/systemd/wpa_supplicant-nl80211@.service.in b/wpa_supplicant/systemd/wpa_supplicant-nl80211@.service.in
index 4d9c146..76aba12 100644
--- a/wpa_supplicant/systemd/wpa_supplicant-nl80211@.service.in
+++ b/wpa_supplicant/systemd/wpa_supplicant-nl80211@.service.in
@@ -10,4 +10,4 @@  Type=simple
 ExecStart=@BINDIR@/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-nl80211-%I.conf -Dnl80211 -i%I
 
 [Install]
-Alias=network.target.wants/wpa_supplicant-nl80211@wlan0.service
+Alias=multi-user.target.wants/wpa_supplicant-nl80211@wlan0.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant-wired@.service.in b/wpa_supplicant/systemd/wpa_supplicant-wired@.service.in
index f2e7f11..ff384ae 100644
--- a/wpa_supplicant/systemd/wpa_supplicant-wired@.service.in
+++ b/wpa_supplicant/systemd/wpa_supplicant-wired@.service.in
@@ -10,4 +10,4 @@  Type=simple
 ExecStart=@BINDIR@/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wired-%I.conf -Dwired -i%I
 
 [Install]
-Alias=network.target.wants/wpa_supplicant-wired@wlan0.service
+Alias=multi-user.target.wants/wpa_supplicant-wired@wlan0.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant.service.in b/wpa_supplicant/systemd/wpa_supplicant.service.in
index 5b947ac..4351ad8 100644
--- a/wpa_supplicant/systemd/wpa_supplicant.service.in
+++ b/wpa_supplicant/systemd/wpa_supplicant.service.in
@@ -7,5 +7,5 @@  BusName=fi.epitest.hostap.WPASupplicant
 ExecStart=@BINDIR@/wpa_supplicant -u
 
 [Install]
-WantedBy=network.target
+WantedBy=multi-user.target
 Alias=dbus-fi.epitest.hostap.WPASupplicant.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant@.service.in b/wpa_supplicant/systemd/wpa_supplicant@.service.in
index 0340b4d..c215567 100644
--- a/wpa_supplicant/systemd/wpa_supplicant@.service.in
+++ b/wpa_supplicant/systemd/wpa_supplicant@.service.in
@@ -10,4 +10,4 @@  Type=simple
 ExecStart=@BINDIR@/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I
 
 [Install]
-Alias=network.target.wants/wpa_supplicant@wlan0.service
+Alias=multi-user.target.wants/wpa_supplicant@wlan0.service