[talk] Add systemd support

vcrhonek vcrhonek at fedoraproject.org
Thu May 2 15:14:52 UTC 2013


commit f87f8598918cb9f29a75a1848ed6cec88ef32e70
Author: Vitezslav Crhonek <vcrhonek at redhat.com>
Date:   Thu May 2 17:14:35 2013 +0200

    Add systemd support

 ntalk.service |   13 +++++++++++++
 ntalk.socket  |    9 +++++++++
 talk.spec     |   39 +++++++++++++++++++++++++++++----------
 3 files changed, 51 insertions(+), 10 deletions(-)
---
diff --git a/ntalk.service b/ntalk.service
new file mode 100644
index 0000000..b16f2f5
--- /dev/null
+++ b/ntalk.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=NTalk Server
+Documentation=man:ntalkd(8) man:talk(1)
+
+[Service]
+User=nobody
+Group=tty
+ExecStart=/usr/sbin/in.ntalkd
+StandardInput=socket
+
+[Install]
+Also=ntalk.socket
+Alias=talk.service
diff --git a/ntalk.socket b/ntalk.socket
new file mode 100644
index 0000000..3c64cbf
--- /dev/null
+++ b/ntalk.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=Talk Server Activation Socket
+Documentation=man:ntalkd(8) man:talk(1)
+
+[Socket]
+ListenDatagram=0.0.0.0:518
+
+[Install]
+WantedBy=sockets.target
diff --git a/talk.spec b/talk.spec
index b31dae4..039128f 100644
--- a/talk.spec
+++ b/talk.spec
@@ -1,16 +1,16 @@
 Summary: Talk client for one-on-one Internet chatting
 Name: talk
 Version: 0.17
-Release: 41%{?dist}
+Release: 42%{?dist}
 License: BSD
 Group: Applications/Internet
 # URL: There's no upstream URL at the moment, here's the latest one.
 URL: http://web.archive.org/web/20070817165301/http://www.hcs.harvard.edu/~dholland/computers/netkit.html
 Source: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-ntalk-%{version}.tar.gz
-# Source1: Xinetd configure for talk.
-Source1: talk-xinetd
-# Source2: Xinetd configure for ntalk.
-Source2: ntalk-xinetd
+# Source1: systemd socket file
+Source1: ntalk.socket
+# Source2: systemd service file
+Source2: ntalk.service
 # Patch0: Includes time.h to the relevant files.
 Patch0: netkit-ntalk-0.17-pre20000412-time.patch
 # Patch1: We don't want to strip compiled files.
@@ -36,7 +36,9 @@ different systems.
 
 %package server
 Group: System Environment/Daemons
-Requires: xinetd
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
 Obsoletes: ntalk < %{version}-%{release}
 Provides: ntalk = %{version}-%{release}
 Summary: The talk server for one-on-one Internet chatting
@@ -78,9 +80,9 @@ mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
 
 make INSTALLROOT=${RPM_BUILD_ROOT} install
 
-mkdir -p ${RPM_BUILD_ROOT}/etc/xinetd.d
-install -m644 %SOURCE1 ${RPM_BUILD_ROOT}/etc/xinetd.d/talk
-install -m644 %SOURCE2 ${RPM_BUILD_ROOT}/etc/xinetd.d/ntalk
+mkdir -p ${RPM_BUILD_ROOT}%{_unitdir}
+install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/ntalk.socket
+install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/ntalk.service
 
 %files
 %{_bindir}/talk
@@ -90,9 +92,26 @@ install -m644 %SOURCE2 ${RPM_BUILD_ROOT}/etc/xinetd.d/ntalk
 %attr(0711,root,root)%{_sbindir}/in.ntalkd
 %{_sbindir}/in.talkd
 %{_mandir}/man8/*
-%config(noreplace) /etc/xinetd.d/*
+%{_unitdir}/ntalk.socket
+%{_unitdir}/ntalk.service
+
+%post server
+%systemd_post ntalk.service
+%systemd_post ntalk.socket
+
+%preun server
+%systemd_preun ntalk.service
+%systemd_preun ntalk.socket
+
+%postun server
+%systemd_postun_with_restart ntalk.service
+%systemd_postun_with_restart ntalk.socket
 
 %changelog
+* Thu May 02 2013 Vitezslav Crhonek <vcrhonek at redhat.com> - 0.17-42
+- Add systemd support
+  Resolves: #737219
+
 * Fri Feb 15 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.17-41
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list