cups/0001-cups.service.in-Add-SYSTEMD_WANTED_BY-variable.patch

34 lines
1.1 KiB
Diff
Raw Normal View History

diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4
index 9e05bd4..505d272 100644
--- a/config-scripts/cups-defaults.m4
+++ b/config-scripts/cups-defaults.m4
@@ -8,6 +8,9 @@ dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
dnl information.
dnl
+dnl Set a default systemd WantedBy directive
+SYSTEMD_WANTED_BY="printers.target"
+
dnl Default languages...
LANGUAGES="`ls -1 locale/cups_*.po 2>/dev/null | sed -e '1,$s/locale\/cups_//' -e '1,$s/\.po//' | tr '\n' ' '`"
@@ -461,3 +464,8 @@ esac
AC_SUBST(CUPS_WEBIF)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_WEBIF, $CUPS_DEFAULT_WEBIF)
+
+AS_IF([test $CUPS_WEBIF = Yes || test $CUPS_BROWSING = Yes], [
+ SYSTEMD_WANTED_BY="$SYSTEMD_WANTED_BY multi-user.target"], [
+ ])
+AC_SUBST([SYSTEMD_WANTED_BY])
diff --git a/scheduler/cups.service.in b/scheduler/cups.service.in
index baff51b..f0d7e2f 100644
--- a/scheduler/cups.service.in
+++ b/scheduler/cups.service.in
@@ -11,4 +11,4 @@ Restart=on-failure
[Install]
Also=cups.socket cups.path
-WantedBy=printer.target
+WantedBy=@SYSTEMD_WANTED_BY@