From c509d7acaccbb92dbf44725ea66fe5ad9fa4c3aa Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Thu, 18 Apr 2024 12:45:19 -0400 Subject: [PATCH] * Thu Apr 18 2024 Jean-Philippe Pialasse 11.0.0-5.sme - move service to full systemd unit [SME: 12635] --- createlinks | 6 ------ root/usr/lib/systemd/system/lpd.service | 13 +++++++------ root/var/service/lpd/down | 0 root/var/service/lpd/run | 2 -- smeserver-LPRng.spec | 14 ++++++++++++-- 5 files changed, 19 insertions(+), 16 deletions(-) delete mode 100644 root/var/service/lpd/down delete mode 100644 root/var/service/lpd/run diff --git a/createlinks b/createlinks index 2f8cb63..fbbaa44 100755 --- a/createlinks +++ b/createlinks @@ -69,9 +69,3 @@ safe_symlink("try-restart", "root/etc/e-smith/events/$event/services2adjust/lpd" templates2events("/etc/systemd/system-preset/49-koozali.preset", $event); event_link("systemd-default", $event, "06"); -#-------------------------------------------------- -# remove for systemd -## Make service statup symlinks -#safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/lpd"); -#safe_symlink("/etc/rc.d/init.d/e-smith-service", "root/etc/rc.d/rc7.d/S60lpd"); -safe_symlink("/var/service/lpd", "root/service/lpd"); diff --git a/root/usr/lib/systemd/system/lpd.service b/root/usr/lib/systemd/system/lpd.service index fe64ce1..99d5e93 100644 --- a/root/usr/lib/systemd/system/lpd.service +++ b/root/usr/lib/systemd/system/lpd.service @@ -1,15 +1,16 @@ [Unit] Description=lpd, LPRng print spool After=network.target -Requires=runit.service [Service] -Type=oneshot +Type=simple +User=root +Group=root +Restart=always +RestartSec=2 +TimeoutSec=0 ExecStartPre=/sbin/e-smith/service-status lpd -ExecStart=/usr/bin/sv u /service/lpd -ExecStop=/usr/bin/sv stop /service/lpd -ExecReload=/usr/bin/sv t /service/lpd -RemainAfterExit=yes +ExecStart=/usr/sbin/lpd -F [Install] WantedBy=sme-server.target diff --git a/root/var/service/lpd/down b/root/var/service/lpd/down deleted file mode 100644 index e69de29..0000000 diff --git a/root/var/service/lpd/run b/root/var/service/lpd/run deleted file mode 100644 index e7c6fe6..0000000 --- a/root/var/service/lpd/run +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -exec /usr/sbin/lpd -F diff --git a/smeserver-LPRng.spec b/smeserver-LPRng.spec index d78016b..163089d 100644 --- a/smeserver-LPRng.spec +++ b/smeserver-LPRng.spec @@ -4,7 +4,7 @@ Summary: smeserver server and gateway - LPRng module %define name smeserver-LPRng Name: %{name} %define version 11.0.0 -%define release 4 +%define release 5 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -25,6 +25,9 @@ smeserver server and gateway software - LPRng module. Add printing features, using the LPRng package. %changelog +* Thu Apr 18 2024 Jean-Philippe Pialasse 11.0.0-5.sme +- move service to full systemd unit [SME: 12635] + * Thu Apr 04 2024 Brian Read 11.0.0-4.sme - Update createlinks to create smeserver-package-update event[SME: 12579] @@ -598,7 +601,6 @@ rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-%{release}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ - --file /var/service/lpd/run 'attr(0755,root,root)' \ > %{name}-%{version}-%{release}-filelist echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist @@ -608,5 +610,13 @@ rm -f /etc/lpd.perms %clean rm -rf $RPM_BUILD_ROOT +%pre +# ease the transition between runit and systemd +if [ $1 -gt 1 ] ; then + if [ -e /var/service/lpd ] ; then + /usr/bin/sv d lpd + fi +fi + %files -f %{name}-%{version}-%{release}-filelist %defattr(-,root,root)