diff --git a/sane-backends.changes b/sane-backends.changes index d6fdc40..79915dd 100644 --- a/sane-backends.changes +++ b/sane-backends.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jun 16 11:42:37 UTC 2017 - nmoudra@suse.com + +- Deleted xinetd service in favor of socked based activation + ------------------------------------------------------------------- Wed May 24 10:02:33 CEST 2017 - jsmeix@suse.de diff --git a/sane-backends.spec b/sane-backends.spec index 889ec9e..bf0ffe1 100644 --- a/sane-backends.spec +++ b/sane-backends.spec @@ -31,11 +31,12 @@ BuildRequires: libusb-1_0-devel BuildRequires: libv4l-devel BuildRequires: net-snmp-devel BuildRequires: pkg-config +%systemd_requires Summary: SANE (Scanner Access Now Easy) Scanner Drivers -License: GPL-2.0+ and SUSE-GPL-2.0+-with-sane-exception and SUSE-Public-Domain -Group: Hardware/Scanner # There is no 1.0.26 release of sane-backends. That number was skipped so that the SANE upstream # development version numbers would more clearly be an extension of the prior release: +License: GPL-2.0+ and SUSE-GPL-2.0+-with-sane-exception and SUSE-Public-Domain +Group: Hardware/Scanner Version: 1.0.27 Release: 0 Url: http://www.sane-project.org/ @@ -50,8 +51,6 @@ Url: http://www.sane-project.org/ # md5sum -c sane-backends-1.0.27.tar.gz.md5 Source0: https://alioth.debian.org/frs/download.php/file/4224/sane-backends-%{version}.tar.gz # Source100... is SUSE specific stuff: -# Source101 is the xinetd file for the saned: -Source101: sane-port # Source102 is the OpenSLP registration file for the saned: Source102: sane.reg # Source110 creates our hpaio.desc file directly from the models.dat file of HPLIP: @@ -72,6 +71,9 @@ Source200: create_scanner_database # to extract the needed info from which create_sane-backends-autoconfig.rules # generates the 56-sane-backends-autoconfig.rules file: Source201: create_sane-backends-autoconfig.rules +# Sources 202 and 203 are files to enable socked based service activation which replaced xinetd +Source202: saned@.service +Source203: saned.socket # Patch2 sane-backends.builttime.patch avoids build-compare noise Patch2: sane-backends.builttime.patch # Patch100... is SUSE specific stuff: @@ -418,9 +420,9 @@ sed -i -e '/^# Epson Perfection 636S /i# Epson Perfection 1640\nKERNEL=="sg[0-9] sed -i -e '/^# Epson Perfection 2450 /i# Any SCSI processor EPSON SCANNER...\nKERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="EPSON", ATTRS{model}=="SCANNER*", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"' tools/udev/libsane.rules # Install the udev rules file: install -m644 tools/udev/libsane.rules %{buildroot}%{_sysconfdir}/udev/rules.d/55-libsane.rules -# xinetd stuff: -install -d -m755 %{buildroot}%{_sysconfdir}/xinetd.d/ -install -m644 %{SOURCE101} %{buildroot}%{_sysconfdir}/xinetd.d/ +# Service files +install -d -m644 %{buildroot}%{_unitdir}/saned@.service +install -d -m644 %{buildroot}%{_unitdir}/saned.socket # OpenSLP registration stuff: install -d -m755 %{buildroot}%{_sysconfdir}/slp.reg.d install -m644 %{SOURCE102} %{buildroot}%{_sysconfdir}/slp.reg.d @@ -430,13 +432,19 @@ rm %{buildroot}%{_defaultdocdir}/sane-backends/{README.aix,README.beos,README.da # https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25find_lang %find_lang sane-backends +%pre +%service_add_pre saned.socket + %post /sbin/ldconfig -exit 0 +%service_add_post saned.socket + +%preun +%service_del_preun saned.socket %postun /sbin/ldconfig -exit 0 +%service_del_postun saned.socket %files -f sane-backends.lang %defattr(-,root,root) @@ -444,7 +452,6 @@ exit 0 %config(noreplace) %{_sysconfdir}/sane.d/*.conf %dir %{_sysconfdir}/slp.reg.d %config(noreplace) %{_sysconfdir}/slp.reg.d/* -%config(noreplace) %{_sysconfdir}/xinetd.d/sane-port %dir %{_sysconfdir}/udev %dir %{_sysconfdir}/udev/rules.d %{_sysconfdir}/udev/rules.d/55-libsane.rules @@ -456,6 +463,8 @@ exit 0 %{_datadir}/sane/ %{_libdir}/libsane.so.* %{_libdir}/sane/ +%{_unitdir}/saned@.service +%{_unitdir}/saned.socket #dir /var/lock/sane %doc %{_defaultdocdir}/sane-backends/ %doc %{_mandir}/man1/scanimage.1.gz diff --git a/sane-port b/sane-port deleted file mode 100644 index 0585076..0000000 --- a/sane-port +++ /dev/null @@ -1,14 +0,0 @@ -# default: off -# description: The saned provides scanner service via the network. \ -# Applications like kooka, xsane or xscanimage can use the remote \ -# scanner. -service sane-port -{ - socket_type = stream - port = 6566 - wait = no - user = root - group = root - server = /usr/sbin/saned - disable = yes -} diff --git a/saned.socket b/saned.socket new file mode 100644 index 0000000..3a07fa1 --- /dev/null +++ b/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/saned@.service b/saned@.service new file mode 100644 index 0000000..c587880 --- /dev/null +++ b/saned@.service @@ -0,0 +1,18 @@ +[Unit] +Description=Scanner Service +Requires=saned.socket + +[Service] +ExecStart=/usr/sbin/saned +User=saned +Group=saned +StandardInput=null +StandardOutput=syslog +StandardError=syslog +Environment=SANE_CONFIG_DIR=@CONFIGDIR@ +# If you need to debug your configuration uncomment the next line and +# change it as appropriate to set the desired debug options +# Environment=SANE_DEBUG_DLL=255 SANE_DEBUG_NET=255 + +[Install] +Also=saned.socket