[systemd-devel] miredo unit files

2011-01-08 Thread Henry Gebhardt
Dear list members,

I have been maintaining a systemd overlay for Gentoo.  Hence i was
contacted about how to get miredo running with systemd.  I herefore
forward you the email, in the hope to get some help as to the proper
solution.  Please find the problem description and proposed solution
below.

Note that systemd-units refers to a temporary package that installs unit
files for various daemons.

On Thu, Jan 06, 2011 at 03:01:44PM +0500, Alexander E. Patrakov wrote:
 Please find attached the modified ebuild for net-misc/miredo and the 
 corresponding files. Note: it is not of the quality needed for 
 inclusion. This is sent for discussion purposes only.
 
 Miredo provides IPv6 connectivity and thus it is IMHO logical for its 
 client service to be wanted by network.target. The server service (note: 
 completely untested, as I don't have a PC with two consecutive IPv4 
 addresses and native IPv6 connectivity) is wanted by multi-user.target 
 because it is just a network daemon.
 
 This cannot go into systemd-units because of a patch that I think is 
 required for correctness. The problem that the patch intends to solve 
 happens to people who use the BindAddress directive in 
 /etc/miredo/miredo.conf. Note, however, that there is no such directive 
 by default.
 
 I don't know the way to tell systemd don't start miredo until the 
 system has the IP address specified in the BindAddress directive. So, 
 systemd starts miredo as soon as it thinks it can. If the address 
 specified in the BindAddress directive is missing at that point, miredo 
 fails. The patch prevents the failure by setting the IP_FREEBIND socket 
 option. So miredo doesn't exit right away, but instead fails to send the 
 initial packet and goes into the retry after 100 seconds mode. The 
 same happens without the patch if miredo is started before a route to 
 the default server appears.
 
 So IPv6 connectivity appears not right after the boot, but 100 seconds 
 later. The constant 100 can be changed:
 
 ./libteredo/maintain.c:static const unsigned RestartDelay = 100; // seconds
 
 but I am not sure if it right to change it. Maybe it is completely wrong 
 to make miredo a service that is wanted by network.target, and instead 
 it should be started and stopped from dhcpcd or NetworkManager hooks. I 
 want your opinion on this matter.
 
 Differences from the existing initscript:
 
 1) Foreground mode, because it is simpler
 2) Removed the ability to pass custom parameters, because I found 
 nothing that is worth allowing the user to change:
 
 -c config_file: would be useful if it made sense to run two teredo 
 tunnels in parallel. However, it doesn't make sense.
 -t or --chrootdir: requires custom setup (copying nss libraries) by the 
 user, likely to break after glibc upgrades.
 -u username or --user username: there is already a user named miredo, 
 no reason to change this
 server_name: settable in the configuration file.
 
 
 -- 
 Alexander E. Patrakov

I didn't attach the ebuild as that is too Gentoo specific.

Thank you,

Henry
[Unit]
Description=Teredo IPv6 tunneling for Unix
After=syslog.target

[Service]
ExecStart=/usr/sbin/miredo -f

[Install]
WantedBy=network.target
diff -ur miredo-1.2.3.orig/libteredo/teredo.c miredo-1.2.3/libteredo/teredo.c
--- miredo-1.2.3.orig/libteredo/teredo.c2011-01-06 11:19:42.0 
+0500
+++ miredo-1.2.3/libteredo/teredo.c 2011-01-06 11:26:42.0 +0500
@@ -82,6 +82,15 @@
 
fcntl (fd, F_SETFD, FD_CLOEXEC);
 
+#ifdef IP_FREEBIND
+   /*
+* Required for race-free startup under systemd,
+* because the order of starting a network interface and miredo
+* is not guaranteed.
+*/
+   setsockopt (fd, SOL_IP, IP_FREEBIND, (int){ 1 }, sizeof (int));
+#endif
+
if (bind (fd, (struct sockaddr *)myaddr, sizeof (myaddr)))
{
close (fd);
[Unit]
Description=Teredo IPv6 tunneling for Unix (server)
After=syslog.target network.target

[Service]
ExecStart=/usr/sbin/miredo-server -f

[Install]
WantedBy=multi-user.target
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Problems with setting up systemd

2011-05-20 Thread Henry Gebhardt
On Fri, May 20, 2011 at 10:37:42AM -0300, Gustavo Sverzut Barbieri wrote:
 On Fri, May 20, 2011 at 9:36 AM, Maciej Piechotka uzytkown...@gmail.com 
 wrote:
  ...
 
  Ok - I won't. The file is:
 
  0.00 1305883630 0.00
  1305883630
  UTC
 
 I guess every Gentoo user that moved to systemd noticed that problem.
 I recall fixing it with my machine and with a friends machine, and
 seems that everytime you boot into openrc it will screw again.

Hm, I just switched to UTC, and booted a few times alternating OpenRC
and systemd, with no problems. Assuming /etc/adjtime is similar as
above, could you post /etc/conf.d/hwclock (please strip the comments)?


Thanks,

Henry
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [ANNOUNCE] systemd 27

2011-05-21 Thread Henry Gebhardt
On Sat, May 21, 2011 at 08:53:14PM +0800, microcai wrote:
 于 2011年05月21日 20:44, Kay Sievers 写道:
  On Sat, May 21, 2011 at 14:39, Lennart Poettering
  lenn...@poettering.net wrote:
  On Sat, 21.05.11 15:22, microcai (micro...@fedoraproject.org) wrote:
 
 
  No, NO, NO! Don't use the release.
 
  It's totally unstable. do some systemctl TAB stuff, systemd crashed.
 
  Hmm?
 
  In which way?
 
  Can you provide a backtrace?
  
  systemd 27 works fine here, the tab-completion too. Seems more like a
  local problem.
 
 Try more times. say, 100 times. systemd will crash eventually.
 

It only crashes with a socket, e.g. systemctl status sshd.socket, even
without tab-completion. The log message is:

May 21 17:30:23 bimsstein kernel: [   22.144845] systemd[1]: Got D-Bus request: 
org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
May 21 17:30:23 bimsstein kernel: [   22.144864] systemd[1]: Running GC...
May 21 17:30:23 bimsstein kernel: [   22.144879] systemd[1]: Got D-Bus request: 
org.freedesktop.systemd1.Manager.LoadUnit() on /org/freedesktop/systemd1
May 21 17:30:23 bimsstein kernel: [   22.145347] systemd[1]: Got D-Bus request: 
org.freedesktop.DBus.Properties.GetAll() on 
/org/freedesktop/systemd1/unit/sshd_2esocket
May 21 17:30:23 bimsstein kernel: [   22.187371] systemd[1]: Caught ABRT, 
dumped core as pid 555.
May 21 17:30:23 bimsstein kernel: [   22.187398] systemd[1]: Freezing execution.

A manual bisect revealed it happens since commit 916abb socket: add
POSIX mqueue support. My core dump doesn't have any symbol names at
all.

Another symptome to mention is that when it occurs, it changes from X to
the console.

HTH,

Henry
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [ANNOUNCE] systemd 27

2011-05-21 Thread Henry Gebhardt
On Sat, May 21, 2011 at 09:25:52PM +0800, microcai wrote:
 于 2011年05月21日 20:44, Kay Sievers 写道:
  On Sat, May 21, 2011 at 14:39, Lennart Poettering
  lenn...@poettering.net wrote:
 
  Can you provide a backtrace?
  
  systemd 27 works fine here, the tab-completion too. Seems more like a
  local problem.
  
  Kay
 
 
 
 Here is the core dump
 

And here is mine, with a few more symbols:

(gdb) bt
#0  0x7fb26667937b in raise () from /lib64/libpthread.so.0
#1  0x00409acb in crash (sig=6) at src/main.c:121
#2  signal handler called
#3  0x7fb2658dc935 in raise () from /lib64/libc.so.6
#4  0x7fb2658dddb6 in abort () from /lib64/libc.so.6
#5  0x7fb2668b8785 in ?? () from /usr/lib64/libdbus-1.so.3
#6  0x7fb2668af8f5 in ?? () from /usr/lib64/libdbus-1.so.3
#7  0x7fb26689d39e in ?? () from /usr/lib64/libdbus-1.so.3
#8  0x7fb26689e4a0 in ?? () from /usr/lib64/libdbus-1.so.3
#9  0x7fb2668a242e in dbus_message_iter_append_basic ()
   from /usr/lib64/libdbus-1.so.3
#10 0x004591de in bus_property_append_long (i=value optimized out, 
property=value optimized out, data=value optimized out)
at src/dbus-common.c:580
#11 0x00459792 in bus_default_message_handler (c=0x1f3e020, 
message=0x1f84930, 
introspection=0x489cf8 !DOCTYPE node PUBLIC \-//freedesktop//DTD D-BUS 
Object Introspection 
1.0//EN\\n\http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\;\nnode\n
 interface name=\org.freedesktop.systemd1.Unit\\n..., interfaces=value 
optimized out, properties=value optimized out)
at src/dbus-common.c:343
#12 0x004478d7 in bus_socket_message_handler (u=0x1e641a0, 
c=0x1f3e020, message=0x1f84930) at src/dbus-socket.c:119
---Type return to continue, or q return to quit---
#13 0x00441be8 in bus_unit_message_dispatch (connection=0x1f3e020, 
message=0x1f84930, data=value optimized out) at src/dbus-unit.c:395
#14 bus_unit_message_handler (connection=0x1f3e020, message=0x1f84930, 
data=value optimized out) at src/dbus-unit.c:570
#15 0x7fb2668a6121 in ?? () from /usr/lib64/libdbus-1.so.3
#16 0x7fb266897db2 in dbus_connection_dispatch ()
   from /usr/lib64/libdbus-1.so.3
#17 0x0043d1ca in bus_dispatch (m=0x1e0b350) at src/dbus.c:547
#18 0x00411bbd in manager_loop (m=0x1e0b350) at src/manager.c:2384
#19 0x0040ab78 in main (argc=value optimized out, 
argv=value optimized out) at src/main.c:1277
(gdb) 

HTH,

Henry
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [ANNOUNCE] systemd 27

2011-05-21 Thread Henry Gebhardt
On Sat, May 21, 2011 at 06:48:35PM +0200, Henry Gebhardt wrote:
 On Sat, May 21, 2011 at 09:25:52PM +0800, microcai wrote:
  于 2011年05月21日 20:44, Kay Sievers 写道:
   On Sat, May 21, 2011 at 14:39, Lennart Poettering
   lenn...@poettering.net wrote:
  
   Can you provide a backtrace?
   
   systemd 27 works fine here, the tab-completion too. Seems more like a
   local problem.
   
   Kay
  
  
  
  Here is the core dump
  
 
 And here is mine, with a few more symbols:

Sorry, the dbus symbols were not there, so here is one also with them:

(gdb) bt
#0  0x7f6d7094537b in raise () from /lib64/libpthread.so.0
#1  0x00409acb in crash (sig=6) at src/main.c:121
#2  signal handler called
#3  0x7f6d6fba8935 in raise () from /lib64/libc.so.6
#4  0x7f6d6fba9db6 in abort () from /lib64/libc.so.6
#5  0x7f6d70ba0795 in _dbus_abort () at 
/var/tmp/portage/sys-apps/dbus-1.4.8-r1/work/dbus-1.4.8/dbus/dbus-sysdeps.c:94
#6  0x7f6d70b8e815 in _dbus_warn_check_failed (
format=0x7f6d70ba7f70 Array or variant type requires that type %s be 
written, but %s was written.\nThe overall signature expected here was '%s' and 
we are on byte %d of that signature.\n)
at 
/var/tmp/portage/sys-apps/dbus-1.4.8-r1/work/dbus-1.4.8/dbus/dbus-internals.c:289
#7  0x7f6d70b72b81 in write_or_verify_typecode (writer=value optimized 
out, typecode=120)
at 
/var/tmp/portage/sys-apps/dbus-1.4.8-r1/work/dbus-1.4.8/dbus/dbus-marshal-recursive.c:1718
#8  0x7f6d70b745dc in _dbus_type_writer_write_basic (writer=0x7fffa8bf8210, 
type=120, value=0x7fffa8bf8158)
at 
/var/tmp/portage/sys-apps/dbus-1.4.8-r1/work/dbus-1.4.8/dbus/dbus-marshal-recursive.c:2314
#9  0x7f6d70b79fa6 in dbus_message_iter_append_basic (iter=0x7fffa8bf8200, 
type=120, value=0x7fffa8bf8158)
at 
/var/tmp/portage/sys-apps/dbus-1.4.8-r1/work/dbus-1.4.8/dbus/dbus-message.c:2596
#10 0x004591de in bus_property_append_long (i=value optimized out, 
property=value optimized out, 
data=value optimized out) at src/dbus-common.c:580
#11 0x00459792 in bus_default_message_handler (c=0x2343d60, 
message=0x230fa20, 
introspection=0x489cf8 !DOCTYPE node PUBLIC \-//freedesktop//DTD D-BUS 
Object Introspection 
1.0//EN\\n\http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\;\nnode\n
 interface name=\org.freedesktop.systemd1.Unit\\n..., 
interfaces=value optimized out, properties=value optimized out) at 
src/dbus-common.c:343
#12 0x004478d7 in bus_socket_message_handler (u=0x222f1a0, c=0x2343d60, 
message=0x230fa20) at src/dbus-socket.c:119
#13 0x00441be8 in bus_unit_message_dispatch (connection=0x2343d60, 
message=0x230fa20, data=value optimized out)
at src/dbus-unit.c:395
#14 bus_unit_message_handler (connection=0x2343d60, message=0x230fa20, 
data=value optimized out) at src/dbus-unit.c:570
#15 0x7f6d70b7ff0c in _dbus_object_tree_dispatch_and_unlock 
(tree=0x23097e0, message=0x230fa20)
at 
/var/tmp/portage/sys-apps/dbus-1.4.8-r1/work/dbus-1.4.8/dbus/dbus-object-tree.c:858
#16 0x7f6d70b69dde in dbus_connection_dispatch (connection=0x2343d60)
at 
/var/tmp/portage/sys-apps/dbus-1.4.8-r1/work/dbus-1.4.8/dbus/dbus-connection.c:4688
#17 0x0043d1ca in bus_dispatch (m=0x21d6350) at src/dbus.c:547
#18 0x00411bbd in manager_loop (m=0x21d6350) at src/manager.c:2384
#19 0x0040ab78 in main (argc=value optimized out, argv=value 
optimized out) at src/main.c:1277

I am not finding the message in syslog that apparently is printed by #6
above. Where can I find it/How can I enable it?

HTH,

Henry
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [ANNOUNCE] systemd 27

2011-05-21 Thread Henry Gebhardt
On Sat, May 21, 2011 at 10:19:39PM +0200, Kay Sievers wrote:
 On Sat, May 21, 2011 at 22:09, Henry Gebhardt
 hsggebha...@googlemail.com wrote:
 
  #10 0x004591de in bus_property_append_long (i=value optimized 
  out, property=value optimized out,
     data=value optimized out) at src/dbus-common.c:580
  #11 0x00459792 in bus_default_message_handler (c=0x2343d60, 
  message=0x230fa20,
 
 Can you try this patch? It should be signed long.

Yes that works!

Thanks,

Henry
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [ PATCH-v2 ] dnsmasq ebuild and unit files for dnsmasq

2011-05-23 Thread Henry Gebhardt
On Sun, May 22, 2011 at 09:18:05PM +0200, Miklos Vajna wrote:
 On Sun, May 22, 2011 at 07:55:09PM +0200, Michał Górny mgo...@gentoo.org 
 wrote:
  Well, that's not entirely guaranteed here. The point is to use
  systemd_dounit() and similar functions because they can decide whether
  to install the service files or not.

Thanks for the clarification.

 
 Hm, but why don't you patch dnsmasq as described in daemon(7), so the
 patch could be upstraemed and other distros would benefit from it as
 well? That sound superior than using systemd_dounit().

And, yes, this would be a good idea.


Thanks,

Henry
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [ PATCH-v2 ] dnsmasq ebuild and unit files for dnsmasq

2011-05-23 Thread Henry Gebhardt
On Mon, May 23, 2011 at 01:19:31PM +0800, microcai wrote:
 于 2011年05月22日 23:22, Henry Gebhardt 写道:
  On Sun, May 22, 2011 at 02:50:00PM +0800, microcai wrote:
 Hope this time I did the right job, once for all. ;)

I've committed it to the systemd overlay for wider testing. It would be
a good idea to indeed patch it as described in daemon(7). Feel free to
send any other changes for review.

 
 As for upstream, I've send him the patch. But we don't want to wait for
 another release, do we?

For getting it into main tree portage that would probably be the right
time to file a bug.


Thanks.

Henry
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/2] wpa_supplicant: Add systemd support

2011-07-11 Thread Henry Gebhardt
---
 .../dbus/fi.epitest.hostap.WPASupplicant.service   |1 +
 wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service  |1 +
 wpa_supplicant/systemd/wpa_supplicant.service  |   11 +++
 wpa_supplicant/systemd/wpa_supplicant@.service |   11 +++
 4 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 wpa_supplicant/systemd/wpa_supplicant.service
 create mode 100644 wpa_supplicant/systemd/wpa_supplicant@.service

diff --git a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service 
b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
index a9ce1ec..2a2edc1 100644
--- a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
+++ b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
@@ -2,3 +2,4 @@
 Name=fi.epitest.hostap.WPASupplicant
 Exec=/sbin/wpa_supplicant -u
 User=root
+SystemdService=wpa_supplicant.service
diff --git a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service 
b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
index df78471..ff40621 100644
--- a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
+++ b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
@@ -2,3 +2,4 @@
 Name=fi.w1.wpa_supplicant1
 Exec=/sbin/wpa_supplicant -u
 User=root
+SystemdService=wpa_supplicant.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant.service 
b/wpa_supplicant/systemd/wpa_supplicant.service
new file mode 100644
index 000..c2610ca
--- /dev/null
+++ b/wpa_supplicant/systemd/wpa_supplicant.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=WPA supplicant
+
+[Service]
+Type=dbus
+BusName=fi.epitest.hostap.WPASupplicant
+ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -u
+
+[Install]
+WantedBy=network.target
+Alias=dbus-fi.epitest.hostap.WPASupplicant.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant@.service 
b/wpa_supplicant/systemd/wpa_supplicant@.service
new file mode 100644
index 000..61847eb
--- /dev/null
+++ b/wpa_supplicant/systemd/wpa_supplicant@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=WPA supplicant daemon (interface-specific version)
+
+# NetworkManager users will probably want the dbus version instead.
+
+[Service]
+Type=simple
+ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -i%I
+
+[Install]
+Alias=network.target.wants/wpa_supplicant@wlan0.service
-- 
1.7.6

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/2] wpa_supplicant: Edit BINDIR in dbus and systemd service files

2011-07-11 Thread Henry Gebhardt
This is useful, since in Gentoo BINDIR=/usr/sbin.
---
 wpa_supplicant/Makefile|9 +
 .../dbus/fi.epitest.hostap.WPASupplicant.service   |5 -
 .../fi.epitest.hostap.WPASupplicant.service.in |5 +
 wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service  |5 -
 .../dbus/fi.w1.wpa_supplicant1.service.in  |5 +
 wpa_supplicant/systemd/wpa_supplicant.service  |   11 ---
 wpa_supplicant/systemd/wpa_supplicant.service.in   |   11 +++
 wpa_supplicant/systemd/wpa_supplicant@.service |   11 ---
 wpa_supplicant/systemd/wpa_supplic...@.service.in  |   11 +++
 9 files changed, 41 insertions(+), 32 deletions(-)
 delete mode 100644 wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
 create mode 100644 
wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
 delete mode 100644 wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
 create mode 100644 wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
 delete mode 100644 wpa_supplicant/systemd/wpa_supplicant.service
 create mode 100644 wpa_supplicant/systemd/wpa_supplicant.service.in
 delete mode 100644 wpa_supplicant/systemd/wpa_supplicant@.service
 create mode 100644 wpa_supplicant/systemd/wpa_supplic...@.service.in

diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 3536084..ded4593 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -21,6 +21,12 @@ ifndef CONFIG_NO_WPA_PASSPHRASE
 ALL += wpa_passphrase
 endif
 
+ALL += systemd/wpa_supplicant.service
+ALL += systemd/wpa_supplicant@.service
+ALL += dbus/fi.epitest.hostap.WPASupplicant.service
+ALL += dbus/fi.w1.wpa_supplicant1.service
+
+
 all: verify_config $(ALL) dynamic_eap_methods
 
 verify_config:
@@ -1422,6 +1428,9 @@ eap_ikev2.so: ../src/eap_peer/eap_ikev2.c 
../src/eap_peer/ikev2.c ../src/eap_com
$(Q)$(CC) -c -o $@ $(CFLAGS) $
@$(E)   CC  $
 
+%.service: %.service.in
+   sed -e 's|\@BINDIR\@|$(BINDIR)|' $ $@
+
 wpa_supplicant.exe: wpa_supplicant
mv -f $ $@
 wpa_cli.exe: wpa_cli
diff --git a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service 
b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
deleted file mode 100644
index 2a2edc1..000
--- a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=fi.epitest.hostap.WPASupplicant
-Exec=/sbin/wpa_supplicant -u
-User=root
-SystemdService=wpa_supplicant.service
diff --git a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in 
b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
new file mode 100644
index 000..a75918f
--- /dev/null
+++ b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
@@ -0,0 +1,5 @@
+[D-BUS Service]
+Name=fi.epitest.hostap.WPASupplicant
+Exec=@BINDIR@/wpa_supplicant -u
+User=root
+SystemdService=wpa_supplicant.service
diff --git a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service 
b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
deleted file mode 100644
index ff40621..000
--- a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=fi.w1.wpa_supplicant1
-Exec=/sbin/wpa_supplicant -u
-User=root
-SystemdService=wpa_supplicant.service
diff --git a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in 
b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
new file mode 100644
index 000..d97ff39
--- /dev/null
+++ b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
@@ -0,0 +1,5 @@
+[D-BUS Service]
+Name=fi.w1.wpa_supplicant1
+Exec=@BINDIR@/wpa_supplicant -u
+User=root
+SystemdService=wpa_supplicant.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant.service 
b/wpa_supplicant/systemd/wpa_supplicant.service
deleted file mode 100644
index c2610ca..000
--- a/wpa_supplicant/systemd/wpa_supplicant.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=WPA supplicant
-
-[Service]
-Type=dbus
-BusName=fi.epitest.hostap.WPASupplicant
-ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -u
-
-[Install]
-WantedBy=network.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
new file mode 100644
index 000..d22fcf9
--- /dev/null
+++ b/wpa_supplicant/systemd/wpa_supplicant.service.in
@@ -0,0 +1,11 @@
+[Unit]
+Description=WPA supplicant
+
+[Service]
+Type=dbus
+BusName=fi.epitest.hostap.WPASupplicant
+ExecStart=@BINDIR@/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -u
+
+[Install]
+WantedBy=network.target
+Alias=dbus-fi.epitest.hostap.WPASupplicant.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant@.service 
b/wpa_supplicant/systemd/wpa_supplicant@.service
deleted file mode 100644
index 61847eb..000
--- a/wpa_supplicant/systemd/wpa_supplicant@.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=WPA supplicant daemon 

[systemd-devel] [PATCH v2 0/2] wpa_supplicant: systemd support and BINDIR

2011-07-12 Thread Henry Gebhardt
Hi,

thank you for all review. Here is the second version of the patches. I haven't
tested the -Dwired and -Dnl80211 versions because I don't use them. Please
consider.

Thanks,

Henry

[PATCH 1/2] wpa_supplicant: Add systemd support
[PATCH 2/2] wpa_supplicant: Edit BINDIR in dbus and systemd service files
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/2] wpa_supplicant: Edit BINDIR in dbus and systemd service files

2011-07-12 Thread Henry Gebhardt
This is useful, since in Gentoo BINDIR=/usr/sbin.
---
 wpa_supplicant/.gitignore  |1 +
 wpa_supplicant/Makefile|   11 +++
 ... = fi.epitest.hostap.WPASupplicant.service.in} |2 +-
 ...t1.service = fi.w1.wpa_supplicant1.service.in} |2 +-
 service = wpa_supplicant-nl80...@.service.in} |2 +-
 ...d@.service = wpa_supplicant-wi...@.service.in} |2 +-
 ...upplicant.service = wpa_supplicant.service.in} |2 +-
 ...plicant@.service = wpa_supplic...@.service.in} |2 +-
 8 files changed, 18 insertions(+), 6 deletions(-)
 create mode 100644 wpa_supplicant/.gitignore
 rename wpa_supplicant/dbus/{fi.epitest.hostap.WPASupplicant.service = 
fi.epitest.hostap.WPASupplicant.service.in} (75%)
 rename wpa_supplicant/dbus/{fi.w1.wpa_supplicant1.service = 
fi.w1.wpa_supplicant1.service.in} (73%)
 rename wpa_supplicant/systemd/{wpa_supplicant-nl80211@.service = 
wpa_supplicant-nl80...@.service.in} (77%)
 rename wpa_supplicant/systemd/{wpa_supplicant-wired@.service = 
wpa_supplicant-wi...@.service.in} (77%)
 rename wpa_supplicant/systemd/{wpa_supplicant.service = 
wpa_supplicant.service.in} (83%)
 rename wpa_supplicant/systemd/{wpa_supplicant@.service = 
wpa_supplic...@.service.in} (79%)

diff --git a/wpa_supplicant/.gitignore b/wpa_supplicant/.gitignore
new file mode 100644
index 000..0e3ad1b
--- /dev/null
+++ b/wpa_supplicant/.gitignore
@@ -0,0 +1 @@
+*.service
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 3536084..4b3f5a0 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -21,6 +21,14 @@ ifndef CONFIG_NO_WPA_PASSPHRASE
 ALL += wpa_passphrase
 endif
 
+ALL += systemd/wpa_supplicant.service
+ALL += systemd/wpa_supplicant@.service
+ALL += systemd/wpa_supplicant-nl80211@.service
+ALL += systemd/wpa_supplicant-wired@.service
+ALL += dbus/fi.epitest.hostap.WPASupplicant.service
+ALL += dbus/fi.w1.wpa_supplicant1.service
+
+
 all: verify_config $(ALL) dynamic_eap_methods
 
 verify_config:
@@ -1422,6 +1430,9 @@ eap_ikev2.so: ../src/eap_peer/eap_ikev2.c 
../src/eap_peer/ikev2.c ../src/eap_com
$(Q)$(CC) -c -o $@ $(CFLAGS) $
@$(E)   CC  $
 
+%.service: %.service.in
+   sed -e 's|\@BINDIR\@|$(BINDIR)|g' $ $@
+
 wpa_supplicant.exe: wpa_supplicant
mv -f $ $@
 wpa_cli.exe: wpa_cli
diff --git a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service 
b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
similarity index 75%
rename from wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
rename to wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
index 2a2edc1..a75918f 100644
--- a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
+++ b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
@@ -1,5 +1,5 @@
 [D-BUS Service]
 Name=fi.epitest.hostap.WPASupplicant
-Exec=/sbin/wpa_supplicant -u
+Exec=@BINDIR@/wpa_supplicant -u
 User=root
 SystemdService=wpa_supplicant.service
diff --git a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service 
b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
similarity index 73%
rename from wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
rename to wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
index ff40621..d97ff39 100644
--- a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
+++ b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
@@ -1,5 +1,5 @@
 [D-BUS Service]
 Name=fi.w1.wpa_supplicant1
-Exec=/sbin/wpa_supplicant -u
+Exec=@BINDIR@/wpa_supplicant -u
 User=root
 SystemdService=wpa_supplicant.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant-nl80211@.service 
b/wpa_supplicant/systemd/wpa_supplicant-nl80...@.service.in
similarity index 77%
rename from wpa_supplicant/systemd/wpa_supplicant-nl80211@.service
rename to wpa_supplicant/systemd/wpa_supplicant-nl80...@.service.in
index 04aa1ba..4d9c146 100644
--- a/wpa_supplicant/systemd/wpa_supplicant-nl80211@.service
+++ b/wpa_supplicant/systemd/wpa_supplicant-nl80...@.service.in
@@ -7,7 +7,7 @@ After=sys-subsystem-net-devices-%i.device
 
 [Service]
 Type=simple
-ExecStart=/sbin/wpa_supplicant 
-c/etc/wpa_supplicant/wpa_supplicant-nl80211-%I.conf -Dnl80211 -i%I
+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
diff --git a/wpa_supplicant/systemd/wpa_supplicant-wired@.service 
b/wpa_supplicant/systemd/wpa_supplicant-wi...@.service.in
similarity index 77%
rename from wpa_supplicant/systemd/wpa_supplicant-wired@.service
rename to wpa_supplicant/systemd/wpa_supplicant-wi...@.service.in
index 83f8c91..f2e7f11 100644
--- a/wpa_supplicant/systemd/wpa_supplicant-wired@.service
+++ b/wpa_supplicant/systemd/wpa_supplicant-wi...@.service.in
@@ -7,7 +7,7 @@ After=sys-subsystem-net-devices-%i.device
 
 [Service]
 Type=simple
-ExecStart=/sbin/wpa_supplicant 
-c/etc/wpa_supplicant/wpa_supplicant-wired-%I.conf -Dwired