Author: baggins                      Date: Sat Apr 21 11:38:44 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- full blown systemd support with per-interface service generator

---- Files affected:
packages/dhcp_probe:
   dhcp_probe-service-generator (1.1 -> 1.2) , dhcp_probe.spec (1.3 -> 1.4) , 
dhcp_probe.sysconfig (1.2 -> 1.3) , [email protected] (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: packages/dhcp_probe/dhcp_probe-service-generator
diff -u packages/dhcp_probe/dhcp_probe-service-generator:1.1 
packages/dhcp_probe/dhcp_probe-service-generator:1.2
--- packages/dhcp_probe/dhcp_probe-service-generator:1.1        Fri Apr 20 
15:05:52 2012
+++ packages/dhcp_probe/dhcp_probe-service-generator    Sat Apr 21 13:38:39 2012
@@ -1,10 +1,18 @@
 #!/bin/sh
 
+destunitdir=${1:-/tmp}
+
 [ -f /etc/sysconfig/dhcp_probe ] && . /etc/sysconfig/dhcp_probe
 
+if [ -d $destunitdir/dhcp_probe.target.wants ]; then
+       rm -f $destunitdir/dhcp_probe.target.wants/dhcp_probe@*.service
+else
+       mkdir -p $destunitdir/dhcp_probe.target.wants
+fi
+
 for nic in $INTERFACES; do
-       [ -d /run/systemd/generator/multi-user.target.wants ] || \
-               mkdir -p /run/systemd/generator/multi-user.target.wants
+       [ -L $destunitdir/dhcp_probe.target.wants/dhcp_probe@$nic.service ] && \
+               continue
        ln -s /lib/systemd/system/[email protected] \
-               
/run/systemd/generator/multi-user.target.wants/dhcp_probe@$nic.service
+               $destunitdir/dhcp_probe.target.wants/dhcp_probe@$nic.service
 done

================================================================
Index: packages/dhcp_probe/dhcp_probe.spec
diff -u packages/dhcp_probe/dhcp_probe.spec:1.3 
packages/dhcp_probe/dhcp_probe.spec:1.4
--- packages/dhcp_probe/dhcp_probe.spec:1.3     Fri Apr 20 15:05:52 2012
+++ packages/dhcp_probe/dhcp_probe.spec Sat Apr 21 13:38:39 2012
@@ -2,7 +2,7 @@
 Summary:       Tool for discovering DHCP and BootP servers
 Name:          dhcp_probe
 Version:       1.3.0
-Release:       0.3
+Release:       0.6
 License:       GPLv2+ and MIT
 Group:         Applications
 Source0:       
http://www.net.princeton.edu/software/dhcp_probe/%{name}-%{version}.tar.gz
@@ -51,7 +51,8 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{systemdunitdir}}
+install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{systemdunitdir}} \
+       $RPM_BUILD_ROOT/lib/systemd/system-generators
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
@@ -61,7 +62,7 @@
 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dhcp_probe
 install -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/[email protected]
 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/dhcp_probe.service
-install -p %{SOURCE4} 
$RPM_BUILD_ROOT/lib/systemd/generators/dhcp_probe-service-generator
+install -p %{SOURCE4} 
$RPM_BUILD_ROOT/lib/systemd/system-generators/dhcp_probe-service-generator
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -89,7 +90,7 @@
 %attr(755,root,root) %{_sbindir}/dhcp_probe
 %attr(754,root,root) /etc/rc.d/init.d/dhcp_probe
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp_probe
-%attr(755,root,root) /lib/systemd/generators/dhcp_probe-service-generator
+%attr(755,root,root) 
/lib/systemd/system-generators/dhcp_probe-service-generator
 %{systemdunitdir}/%{name}.service
 %{systemdunitdir}/%{name}@.service
 %{_mandir}/man5/dhcp_probe.cf.5*
@@ -101,6 +102,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.4  2012/04/21 11:38:39  baggins
+- full blown systemd support with per-interface service generator
+
 Revision 1.3  2012/04/20 13:05:52  baggins
 - add generator for systemd services
 

================================================================
Index: packages/dhcp_probe/dhcp_probe.sysconfig
diff -u packages/dhcp_probe/dhcp_probe.sysconfig:1.2 
packages/dhcp_probe/dhcp_probe.sysconfig:1.3
--- packages/dhcp_probe/dhcp_probe.sysconfig:1.2        Fri Apr 20 15:05:52 2012
+++ packages/dhcp_probe/dhcp_probe.sysconfig    Sat Apr 21 13:38:39 2012
@@ -2,4 +2,11 @@
 #DHCP_PROBE_OPTIONS=
 
 # Space separated list of interfaces to listen on.
-#INTERFACES="eth0 eth1"
+#
+# On systems running systemd after updating the list below you have to
+# restart systemd to regenerate [email protected] services
+# (systemctl --system daemon-reload), stop and start dhcp_probe.target when
+# removing elements from list or restart dhcp_probe.target when only adding
+# elements (systemctl stop dhcp_probe.target / systemctl restart 
dhcp_probe.target).
+#
+INTERFACES="eth0"

================================================================
Index: packages/dhcp_probe/[email protected]
diff -u packages/dhcp_probe/[email protected]:1.2 
packages/dhcp_probe/[email protected]:1.3
--- packages/dhcp_probe/[email protected]:1.2 Fri Apr 20 15:05:52 2012
+++ packages/dhcp_probe/[email protected]     Sat Apr 21 13:38:39 2012
@@ -1,10 +1,14 @@
 [Unit]
-Description=Start dhcp_probe on %I
-After=network.target
-Wants=network.target
+Description=dhcp_probe on %I
+Requires=dhcp_probe.target
+After=dhcp_probe.target
+PropagateReloadFrom=dhcp_probe.target
 
 [Service]
 Type=forking
 EnvironmentFile=-/etc/sysconfig/dhcp_probe
 PIDFile=/var/run/dhcp_probe.%I.pid
 ExecStart=/usr/sbin/dhcp_probe $DHCP_PROBE_OPTIONS -p 
/var/run/dhcp_probe.%I.pid %I
+
+[Install]
+WantedBy=dhcp_probe.target
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/packages/dhcp_probe/dhcp_probe-service-generator?r1=1.1&r2=1.2
    http://cvs.pld-linux.org/packages/dhcp_probe/dhcp_probe.spec?r1=1.3&r2=1.4
    
http://cvs.pld-linux.org/packages/dhcp_probe/dhcp_probe.sysconfig?r1=1.2&r2=1.3
    
http://cvs.pld-linux.org/packages/dhcp_probe/[email protected]?r1=1.2&r2=1.3

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to