Blob Blame Raw
diff -up cups-2.2.2/scheduler/main.c.systemd-socket cups-2.2.2/scheduler/main.c
--- cups-2.2.2/scheduler/main.c.systemd-socket	2017-01-19 11:12:42.004520240 +0100
+++ cups-2.2.2/scheduler/main.c	2017-01-19 11:12:42.029520021 +0100
@@ -690,8 +690,15 @@ main(int  argc,				/* I - Number of comm
 
 #if defined(HAVE_ONDEMAND)
   if (OnDemand)
+  {
     cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started on demand.");
-  else
+# ifdef HAVE_SYSTEMD
+    sd_notifyf(0, "READY=1\n"
+               "STATUS=Scheduler is running...\n"
+               "MAINPID=%lu",
+               (unsigned long) getpid());
+# endif /* HAVE_SYSTEMD */
+  } else
 #endif /* HAVE_ONDEMAND */
   if (fg)
     cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started in foreground.");
diff -up cups-2.2.2/scheduler/org.cups.cupsd.path.in.systemd-socket cups-2.2.2/scheduler/org.cups.cupsd.path.in
--- cups-2.2.2/scheduler/org.cups.cupsd.path.in.systemd-socket	2017-01-19 11:12:42.029520021 +0100
+++ cups-2.2.2/scheduler/org.cups.cupsd.path.in	2017-01-19 11:19:34.468933097 +0100
@@ -3,7 +3,7 @@ Description=CUPS Scheduler
 PartOf=org.cups.cupsd.service
 
 [Path]
-PathExists=@CUPS_CACHEDIR@/org.cups.cupsd
+PathExistsGlob=@CUPS_REQUESTS@/d*
 
 [Install]
 WantedBy=multi-user.target
diff -up cups-2.2.2/scheduler/org.cups.cupsd.service.in.systemd-socket cups-2.2.2/scheduler/org.cups.cupsd.service.in
--- cups-2.2.2/scheduler/org.cups.cupsd.service.in.systemd-socket	2017-01-17 20:27:22.000000000 +0100
+++ cups-2.2.2/scheduler/org.cups.cupsd.service.in	2017-01-19 11:12:42.029520021 +0100
@@ -1,10 +1,11 @@
 [Unit]
 Description=CUPS Scheduler
 Documentation=man:cupsd(8)
+After=network.target
 
 [Service]
 ExecStart=@sbindir@/cupsd -l
-Type=simple
+Type=notify
 
 [Install]
 Also=org.cups.cupsd.socket org.cups.cupsd.path