From e2a49a41b6bdfb0232ff4b523bded4a3b4b555b2 Mon Sep 17 00:00:00 2001 From: Sérgio M. Basto Date: Aug 10 2016 04:20:46 +0000 Subject: Add Packaging:Systemd --- diff --git a/noip.service b/noip.service new file mode 100644 index 0000000..0f6fba0 --- /dev/null +++ b/noip.service @@ -0,0 +1,11 @@ +[Unit] +Description=No-IP Dynamic DNS Update Client +Requires=systemd-resolved.service +After=systemd-resolved.service + +[Service] +Type=forking +ExecStart=/usr/sbin/noip2 -c /etc/no-ip2.conf + +[Install] +WantedBy=multi-user.target diff --git a/noip.spec b/noip.spec index 57e9b07..5c14b7c 100644 --- a/noip.spec +++ b/noip.spec @@ -1,11 +1,12 @@ Name: noip Version: 2.1.9 -Release: 17%{?dist} +Release: 18%{?dist} Summary: A dynamic DNS update client Group: System Environment/Daemons License: GPLv2+ URL: http://www.no-ip.com Source0: http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz +Source1: noip.service # Patch for Fedora specifics Patch0: noip.patch @@ -15,6 +16,7 @@ Requires(post): chkconfig Requires(preun): chkconfig # This is for /sbin/service Requires(preun): initscripts +BuildRequires: systemd %description Keep your current IP address in sync with your No-IP host or domain with @@ -41,8 +43,9 @@ install -D -p -m 755 noip2 %{buildroot}/%{_sbindir}/noip2 mkdir -p %{buildroot}/%{_sysconfdir} touch %{buildroot}/%{_sysconfdir}/no-ip2.conf +install -Dm644 %{SOURCE1} %{buildroot}%{_unitdir}/noip.service # Install init script -install -D -p -m 755 redhat.noip.sh %{buildroot}%{_initrddir}/noip +#install -D -p -m 755 redhat.noip.sh %{buildroot}%{_initrddir}/noip %pre # Add noip user & group @@ -56,9 +59,19 @@ getent passwd noip >/dev/null || \ /sbin/chkconfig --add noip %preun -if [ $1 = 0 ] ; then - /sbin/service noip stop >/dev/null 2>&1 - /sbin/chkconfig --del noip +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable noip > /dev/null 2>&1 || : + /bin/systemctl stop noip > /dev/null 2>&1 || : +fi +/bin/systemctl daemon-reload >/dev/null 2>&1 || : + +%postun +if [ $1 -eq 0 ] ; then + # Package upgrade, not uninstall + # Web service + # Run these because the SysV package being removed won't do them + /sbin/chkconfig --del noip >/dev/null 2>&1 || : fi %files @@ -66,9 +79,12 @@ fi %doc COPYING README.FIRST %{_sbindir}/noip2 %attr(600,noip,noip) %config(noreplace) %{_sysconfdir}/no-ip2.conf -%{_initrddir}/noip +%{_unitdir}/noip.service %changelog +* Wed Aug 10 2016 Sérgio Basto - 2.1.9-18 +- Add Packaging:Systemd + * Thu Feb 04 2016 Fedora Release Engineering - 2.1.9-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild