summaryrefslogtreecommitdiff
blob: 2f88924ee2d554bd1a7b4ec99c3587925c829d6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff --git a/scheduler/main.c b/scheduler/main.c
index b1aa503..2f0f5fe 100644
--- a/scheduler/main.c
+++ b/scheduler/main.c
@@ -656,8 +656,15 @@ main(int  argc,				/* I - Number of command-line args */
 
 #if defined(HAVE_LAUNCHD) || defined(HAVE_SYSTEMD)
   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_LAUNCHD || HAVE_SYSTEMD */
   if (fg)
     cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started in foreground.");
diff --git a/scheduler/org.cups.cupsd.path.in b/scheduler/org.cups.cupsd.path.in
index 1bccc6f..4564164 100644
--- a/scheduler/org.cups.cupsd.path.in
+++ b/scheduler/org.cups.cupsd.path.in
@@ -2,7 +2,7 @@
 Description=CUPS Scheduler
 
 [Path]
-PathExists=@CUPS_CACHEDIR@/org.cups.cupsd
+PathExistsGlob=@CUPS_REQUESTS@/d*
 
 [Install]
 WantedBy=multi-user.target
diff --git a/scheduler/org.cups.cupsd.service.in b/scheduler/org.cups.cupsd.service.in
index 0a27c76..0a841a2 100644
--- a/scheduler/org.cups.cupsd.service.in
+++ b/scheduler/org.cups.cupsd.service.in
@@ -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