From 4a1b265adcc16b6440e7a75c84a85e8b0dc11c0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Fonzo?= Date: Wed, 28 Sep 2022 21:37:31 -0300 Subject: [PATCH] recipes: printing/cups-filters: Added daemon handling for cups-browsed(8) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Matías Fonzo --- archive/cups-filters/rc.log | 10 +++++++ archive/cups-filters/rc.main | 41 ++++++++++++++++++++++++++++ archive/dragora-installer/parts/ConfServices | 7 +++-- recipes/printing/cups-filters/recipe | 18 ++++++++++-- recipes/tools/dragora-installer/recipe | 2 +- 5 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 archive/cups-filters/rc.log create mode 100644 archive/cups-filters/rc.main diff --git a/archive/cups-filters/rc.log b/archive/cups-filters/rc.log new file mode 100644 index 00000000..da0de2ef --- /dev/null +++ b/archive/cups-filters/rc.log @@ -0,0 +1,10 @@ +#! /bin/sh - +# +# Generic perpetrate(5) runscript for cups-browsed(8). +# + +if test "$1" = start +then + exec tinylog_run "$2" +fi + diff --git a/archive/cups-filters/rc.main b/archive/cups-filters/rc.main new file mode 100644 index 00000000..030deb89 --- /dev/null +++ b/archive/cups-filters/rc.main @@ -0,0 +1,41 @@ +#! /bin/sh - +# +# cups-browsed/rc.main +# +# A daemon for browsing the Bonjour broadcasts of shared, remote CUPS printers. +# + +# Redirects the standard error to the standard output +exec 2>&1 + +TARGET="$1" +SVNAME="${2:-cups-browsed}" + +start() +{ + echo "*** ${SVNAME}: Starting cups-browsed ..." + + # Check first if 'cupsd' is running before to run 'cups-browsed' + perpok cupsd || exit $? + + exec /usr/sbin/cups-browsed -d +} + +reset() +{ + case $3 in + exit) + echo "*** ${SVNAME}: Exited status $4" + ;; + signal) + echo "*** ${SVNAME}: Killed on signal $5" + ;; + *) + echo "*** ${SVNAME}: Stopped (${3})" + ;; + esac +} + +# Branch to target +eval ${TARGET} "$@" + diff --git a/archive/dragora-installer/parts/ConfServices b/archive/dragora-installer/parts/ConfServices index b6f113eb..71308461 100644 --- a/archive/dragora-installer/parts/ConfServices +++ b/archive/dragora-installer/parts/ConfServices @@ -44,10 +44,11 @@ EOF addEntry acpid "Advanced Configuration and Power Interface event daemon." addEntry connmand "A daemon for managing Internet connections." addEntry crond "Cron daemon. [required]" +addEntry cups-browsed "Remote CUPS printers (If selected, you must also select 'cupsd') addEntry cupsd "CUPS scheduler." addEntry dbus "D-Bus daemon." addEntry devmon "Device monitor (udevil)." -addEntry dhcpcd "DHCP client/daemon (If selected you should deselect 'connmand' to avoid conflicts)" +addEntry dhcpcd "DHCP client/daemon (If selected, deselect 'connmand' to avoid conflicts)" addEntry inetd "Internet super-server." addEntry sshd "The OpenSSH (SSH) daemon." addEntry syslogd "Log systems messages. [required]" @@ -63,8 +64,8 @@ echo ' 2> "${SUBTMPDIR}/return-ConfServices"' >> "${SUBTMPDIR}/ConfServices" test -s "${SUBTMPDIR}/return-ConfServices" || return 0; # Set sticky bit according to the selection -for service in acpid connmand crond cupsd dbus devmon dhcpcd inetd \ - sshd syslogd udevd ; \ +for service in acpid connmand crond cups-browsed cupsd dbus devmon dhcpcd \ + inetd sshd syslogd udevd ; \ do if grep -q -o -m 1 "$service" "${SUBTMPDIR}/return-ConfServices" then diff --git a/recipes/printing/cups-filters/recipe b/recipes/printing/cups-filters/recipe index e432ec4e..dfef92ab 100644 --- a/recipes/printing/cups-filters/recipe +++ b/recipes/printing/cups-filters/recipe @@ -19,7 +19,7 @@ set -e program=cups-filters version=1.28.16 -release=1 +release=2 # Define a category for the output of the package name pkgcategory=printing @@ -78,9 +78,23 @@ build() make -j${jobs} check make -j${jobs} DESTDIR="$destdir" install + # Install CUPS-BROWSED perp service + + mkdir -p "${destdir}/etc/perp/cups-browsed" + + cp -p "${worktree}/archive/cups-filters/rc.log" \ + "${worktree}/archive/cups-filters/rc.main" \ + "${destdir}/etc/perp/cups-browsed/" + + chmod 755 "${destdir}"/etc/perp/cups-browsed/rc.* + + # Do not enable cups-browsed by default + chmod -t "${destdir}/etc/perp/cups-browsed" + # To handle (dot) .new files via graft(1) - touch "${destdir}/etc/cups/.graft-config" + touch "${destdir}/etc/perp/cups-browsed/.graft-config" \ + "${destdir}/etc/cups/.graft-config" # Compress and link man pages (if needed) if test -d "${destdir}/$mandir" diff --git a/recipes/tools/dragora-installer/recipe b/recipes/tools/dragora-installer/recipe index 166c3dc3..962ec893 100644 --- a/recipes/tools/dragora-installer/recipe +++ b/recipes/tools/dragora-installer/recipe @@ -18,7 +18,7 @@ set -e program=dragora-installer -version=20220915 +version=20220928 release=1 # Define a category for the output of the package name -- 2.11.4.GIT