[cvs/f17] Allow to stop all server instances by stopping cvs.target

Petr Pisar ppisar at fedoraproject.org
Tue Feb 12 12:50:12 UTC 2013


commit ab11ad65605ab8ba5190118041896df7ac6a5ece
Author: Petr Písař <ppisar at redhat.com>
Date:   Tue Feb 12 11:45:20 2013 +0100

    Allow to stop all server instances by stopping cvs.target

 cvs.socket   |    1 +
 cvs.spec     |    4 ++++
 cvs.target   |    2 ++
 cvs at .service |    1 +
 4 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/cvs.socket b/cvs.socket
index 04f1d0a..607d770 100644
--- a/cvs.socket
+++ b/cvs.socket
@@ -1,5 +1,6 @@
 [Unit]
 Description=CVS Server Activation Socket
+PartOf=cvs.target
 
 [Socket]
 ListenStream=2401
diff --git a/cvs.spec b/cvs.spec
index 41d1288..9b7fd2c 100644
--- a/cvs.spec
+++ b/cvs.spec
@@ -20,6 +20,7 @@ Source3: cvs.sh
 Source4: cvs.csh
 Source5: cvs at .service
 Source6: cvs.socket
+Source7: cvs.target
 Requires(post): /sbin/install-info, systemd-units
 Requires(preun): /sbin/install-info, systemd-units
 Requires(postun): systemd-units
@@ -201,6 +202,7 @@ install -D -m 644 %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d/cvs.sh
 install -D -m 644 %{SOURCE4} $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d/cvs.csh
 install -p -m 644 -D %{SOURCE5} $RPM_BUILD_ROOT%{_unitdir}/cvs\@.service
 install -p -m 644 -D %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/cvs.socket
+install -p -m 644 -D %{SOURCE7} $RPM_BUILD_ROOT%{_unitdir}/cvs.target
 
 
 %post
@@ -219,6 +221,7 @@ if [ $1 -eq 0 ] ; then
     /sbin/install-info --delete /%{_infodir}/cvsclient.info.gz /%{_infodir}/dir
     /bin/systemctl --no-reload disable cvs.socket > /dev/null 2>&1 || :
     /bin/systemctl stop cvs.socket > /dev/null 2>&1 || :
+    /bin/systemctl stop cvs.target > /dev/null 2>&1 || :
 fi
 exit 0
 
@@ -258,6 +261,7 @@ fi
 %changelog
 * Tue Feb 12 2013 Petr Pisar <ppisar at redhat.com> - 1.11.23-26
 - Correct handling systemd service (bug #737264)
+- Allow to stop all server instances by stopping cvs.target
 
 * Mon Feb 06 2012 Petr Pisar <ppisar at redhat.com> - 1.11.23-25
 - Fix CVE-2012-0804 (bug #787683)
diff --git a/cvs.target b/cvs.target
new file mode 100644
index 0000000..a01d40c
--- /dev/null
+++ b/cvs.target
@@ -0,0 +1,2 @@
+[Unit]
+Description=CVS Servers
diff --git a/cvs at .service b/cvs at .service
index 623d76f..27ffcec 100644
--- a/cvs at .service
+++ b/cvs at .service
@@ -1,6 +1,7 @@
 [Unit]
 Description=CVS Server
 After=local-fs.target
+PartOf=cvs.target
 
 [Service]
 Environment=HOME=/var/cvs


More information about the scm-commits mailing list