From 1f9d7dbe8c4e55956f8cb274d74d156ed2d35722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 26 Dec 2014 11:58:57 +0100 Subject: some release changes, correct systemd --- debian/changelog | 17 +++++++++++++++++ debian/rules | 6 ++++-- debian/sane-utils.README.Debian | 11 +++++++++++ debian/sane-utils.install | 2 ++ debian/sane-utils.lintian-overrides | 5 +++++ debian/sane-utils.postrm | 13 +++++++++++++ debian/sane-utils.saned.default | 3 ++- debian/sane-utils.saned.socket | 10 ---------- debian/sane-utils.saned@.service | 16 ---------------- debian/saned.socket | 10 ++++++++++ debian/saned@.service | 17 +++++++++++++++++ 11 files changed, 81 insertions(+), 29 deletions(-) delete mode 100644 debian/sane-utils.saned.socket delete mode 100644 debian/sane-utils.saned@.service create mode 100644 debian/saned.socket create mode 100644 debian/saned@.service (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 15fb95e..65c3fef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +sane-backends (1.0.24-7) unstable; urgency=medium + + * debian/rules: + - Split dh_installinit in two parts for systemd and SysV-style. + - Install systemd files without dh to prevent sideeffects (Closes: #773320). + - Override dh_systemd_enable to don't enable saned.socked. + * debian/sane-utils.lintian-overrides: + - Override systemd-no-service-for-init-script. + * debian/sane-utils.postrm: + - Add purge the manual installed files. + * debian/sane-utils.README.Debian: + - Add handling with systemd. + * debian/sane-utils.saned.default: + - Add note for enabling under systemd. + + -- Jörg Frings-Fürst Wed, 17 Dec 2014 09:18:47 +0100 + sane-backends (1.0.24-6) unstable; urgency=medium * Revert changes from 1.0.24-5. diff --git a/debian/rules b/debian/rules index b04da9d..5fc4afb 100755 --- a/debian/rules +++ b/debian/rules @@ -125,8 +125,10 @@ endif chrpath -d debian/sane-utils/usr/bin/sane-find-scanner override_dh_installinit: - dh_installinit -psane-utils --name=saned@ --error-handler=saned_eh - cp $(CURDIR)/debian/sane-utils.saned.socket $(CURDIR)/debian/sane-utils/lib/systemd/system/saned.socket + dh_installinit -psane-utils --name=saned --error-handler=saned_eh + +override_dh_systemd_enable: + dh_systemd_enable --no-enable saned.socket override_dh_strip: dh_strip --dbg-package=libsane-dbg diff --git a/debian/sane-utils.README.Debian b/debian/sane-utils.README.Debian index 2fb74d4..d5dd23f 100644 --- a/debian/sane-utils.README.Debian +++ b/debian/sane-utils.README.Debian @@ -57,6 +57,16 @@ To disable saned, use update-inetd to disable the service: If you want to run saned under another user and/or group, edit /etc/inetd.conf and change saned:saned for the appropriate user:group combination. + Running saned from systemd + -------------------------- + +To enable saned in the default configuration (running as user and group saned), +use systemctl to enable the service: + # systemctl enable saned.socket +To disable saned, use systemctl to disable the service: + # systemctl disable saned.socket + + Running saned as a standalone daemon ------------------------------------ @@ -70,3 +80,4 @@ To run saned as a standalone server: -- Julien BLACHE , Mon, 05 May 2008 19:29:28 +0200 +-- Jörg Frings-Fürst Tue, 16 Dec 2014 22:04:23 +0100 diff --git a/debian/sane-utils.install b/debian/sane-utils.install index b16ddd3..a953300 100644 --- a/debian/sane-utils.install +++ b/debian/sane-utils.install @@ -8,3 +8,5 @@ usr/share/man/man1/sane-find-scanner.1 usr/share/man/man1/scanimage.1 usr/share/man/man8/saned.8 tools/umax_pp usr/bin +debian/saned.socket lib/systemd/system +debian/saned@.service lib/systemd/system diff --git a/debian/sane-utils.lintian-overrides b/debian/sane-utils.lintian-overrides index 32a16bc..41e796f 100644 --- a/debian/sane-utils.lintian-overrides +++ b/debian/sane-utils.lintian-overrides @@ -2,3 +2,8 @@ # User enabled. See sane-utils.README.Debian # postrm-contains-additional-updaterc.d-calls + +# +# False positives. See Debian bug # +# +systemd-no-service-for-init-script diff --git a/debian/sane-utils.postrm b/debian/sane-utils.postrm index 5ebdada..a11d248 100644 --- a/debian/sane-utils.postrm +++ b/debian/sane-utils.postrm @@ -7,6 +7,19 @@ if [ "$1" = purge ]; then update-inetd --remove sane-port update-inetd --remove "## sane-port" fi +# +# purge systemd files +# + rm -f /etc/systemd/system/saned.socket + rm -f /var/lib/systemd/deb-systemd-helper-enabled/saned.socket.dsh-also + rm -f /var/lib/systemd/deb-systemd-helper-masked/saned.socket + if [ -d /var/lib/systemd/deb-systemd-helper-enabled ]; then + rmdir --ignore-fail-on-non-empty /var/lib/systemd/deb-systemd-helper-enabled + fi + if [ -d /var/lib/systemd/deb-systemd-helper-masked ]; then + rmdir --ignore-fail-on-non-empty /var/lib/systemd/deb-systemd-helper-masked + fi + fi #DEBHELPER# diff --git a/debian/sane-utils.saned.default b/debian/sane-utils.saned.default index 4ea0cac..b0647cc 100644 --- a/debian/sane-utils.saned.default +++ b/debian/sane-utils.saned.default @@ -1,6 +1,7 @@ # Defaults for the saned initscript, from sane-utils -# Set to yes to start saned +# To enable under systemd please read README.Debian +# Set to yes to start saned under SysV RUN=no # Set to the user saned should run as diff --git a/debian/sane-utils.saned.socket b/debian/sane-utils.saned.socket deleted file mode 100644 index 1aa19e7..0000000 --- a/debian/sane-utils.saned.socket +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=saned incoming socket - -[Socket] -ListenStream=6566 -Accept=yes -MaxConnections=1 - -[Install] -WantedBy=sockets.target diff --git a/debian/sane-utils.saned@.service b/debian/sane-utils.saned@.service deleted file mode 100644 index e9fc879..0000000 --- a/debian/sane-utils.saned@.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Scanner Service -Requires=saned.socket - -[Service] -ExecStart=/usr/sbin/saned -User=saned -Group=saned -StandardInput=socket -StandardOutput=syslog -StandardError=syslog -Environment=SANE_CONFIG_DIR=/etc/sane.d -# Environment=SANE_CONFIG_DIR=/etc/sane.d SANE_DEBUG_DLL=255 - -[Install] -Also=saned.socket diff --git a/debian/saned.socket b/debian/saned.socket new file mode 100644 index 0000000..1aa19e7 --- /dev/null +++ b/debian/saned.socket @@ -0,0 +1,10 @@ +[Unit] +Description=saned incoming socket + +[Socket] +ListenStream=6566 +Accept=yes +MaxConnections=1 + +[Install] +WantedBy=sockets.target diff --git a/debian/saned@.service b/debian/saned@.service new file mode 100644 index 0000000..8b406eb --- /dev/null +++ b/debian/saned@.service @@ -0,0 +1,17 @@ +[Unit] +Description=Scanner Service +Requires=saned.socket +Alias=saned + +[Service] +ExecStart=/usr/sbin/saned +User=saned +Group=saned +StandardInput=socket +StandardOutput=syslog +StandardError=syslog +Environment=SANE_CONFIG_DIR=/etc/sane.d +# Environment=SANE_CONFIG_DIR=/etc/sane.d SANE_DEBUG_DLL=255 + +[Install] +Also=saned.socket -- cgit v1.2.3