summaryrefslogtreecommitdiff
path: root/scheduler/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'scheduler/main.c')
-rw-r--r--scheduler/main.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/scheduler/main.c b/scheduler/main.c
index 4e9dc44b0..aee1b1111 100644
--- a/scheduler/main.c
+++ b/scheduler/main.c
@@ -978,18 +978,39 @@ main(int argc, /* I - Number of command-line args */
"Scheduler shutting down due to program error.");
/*
- * Close all network clients and stop all jobs...
+ * Close all network clients...
*/
cupsdStopServer();
+#ifdef HAVE_LAUNCHD
+ /*
+ * Update the launchd KeepAlive file as needed...
+ */
+
+ if (Launchd)
+ launchd_checkout();
+#endif /* HAVE_LAUNCHD */
+
+ /*
+ * Stop all jobs...
+ */
+
cupsdFreeAllJobs();
#ifdef __APPLE__
+ /*
+ * Stop monitoring system event monitoring...
+ */
+
cupsdStopSystemMonitor();
#endif /* __APPLE__ */
#ifdef HAVE_GSSAPI
+ /*
+ * Free the scheduler's Kerberos context...
+ */
+
# ifdef __APPLE__
/*
* If the weak-linked GSSAPI/Kerberos library is not present, don't try
@@ -998,23 +1019,9 @@ main(int argc, /* I - Number of command-line args */
if (krb5_init_context != NULL)
# endif /* __APPLE__ */
-
- /*
- * Free the scheduler's Kerberos context...
- */
-
krb5_free_context(KerberosContext);
#endif /* HAVE_GSSAPI */
-#ifdef HAVE_LAUNCHD
- /*
- * Update the launchd KeepAlive file as needed...
- */
-
- if (Launchd)
- launchd_checkout();
-#endif /* HAVE_LAUNCHD */
-
#ifdef __APPLE__
#ifdef HAVE_DLFCN_H
/*