185
184
GError *error = NULL;
187
186
/* Set up /var/run/gdm */
188
if (!ensure_dir_with_perms (GDM_RAN_ONCE_MARKER_DIR, 0, gid, (S_IRWXU | S_IRWXG), &error)) {
187
if (!ensure_dir_with_perms (GDM_RAN_ONCE_MARKER_DIR, 0, gid, 0711, &error)) {
189
188
gdm_fail (_("Failed to create ran once marker dir %s: %s"),
190
189
GDM_RAN_ONCE_MARKER_DIR, error->message);
193
192
/* Set up /var/gdm */
194
if (!ensure_dir_with_perms (AUTHDIR, uid, gid, (S_IRWXU | S_IRWXG | S_ISVTX), &error)) {
193
if (!ensure_dir_with_perms (AUTHDIR, uid, gid, 0711, &error)) {
195
194
gdm_fail (_("Failed to create AuthDir %s: %s"),
196
195
AUTHDIR, error->message);
199
198
/* Set up /var/log/gdm */
200
if (!ensure_dir_with_perms (LOGDIR, 0, gid, (S_IRWXU | S_IRWXG | S_ISVTX), &error)) {
199
if (!ensure_dir_with_perms (LOGDIR, 0, gid, 0711, &error)) {
201
200
gdm_fail (_("Failed to create LogDir %s: %s"),
202
201
LOGDIR, error->message);
270
signal_cb (int signo,
275
g_debug ("Got callback for signal %d", signo);
282
/* let the fatal signals interrupt us */
283
g_debug ("Caught signal %d, shutting down abnormally.", signo);
290
/* let the fatal signals interrupt us */
291
g_debug ("Caught signal %d, shutting down normally.", signo);
297
g_debug ("Got HUP signal");
298
/* Reread config stuff like system config files, VPN service
301
g_object_unref (settings);
302
settings = gdm_settings_new ();
303
if (settings != NULL) {
304
if (! gdm_settings_direct_init (settings, DATADIR "/gdm/gdm.schemas", "/")) {
305
g_warning ("Unable to initialize settings");
269
on_shutdown_signal_cb (gpointer user_data)
271
GMainLoop *mainloop = user_data;
273
g_main_loop_quit (mainloop);
279
on_sighup_cb (gpointer user_data)
281
g_debug ("Got HUP signal");
282
/* Reread config stuff like system config files, VPN service
285
g_object_unref (settings);
286
settings = gdm_settings_new ();
287
if (settings != NULL) {
288
if (! gdm_settings_direct_init (settings, DATADIR "/gdm/gdm.schemas", "/")) {
289
g_warning ("Unable to initialize settings");
314
g_debug ("Got USR1 signal");
316
* Play with log levels or something
320
gdm_log_toggle_debug ();
325
g_debug ("Caught unhandled signal %d", signo);
297
on_sigusr1_cb (gpointer user_data)
299
g_debug ("Got USR1 signal");
301
gdm_log_toggle_debug ();
377
346
context = g_option_context_new (_("GNOME Display Manager"));
378
347
g_option_context_add_main_entries (context, entries, NULL);
379
348
g_option_context_set_ignore_unknown_options (context, TRUE);
441
410
main_loop = g_main_loop_new (NULL, FALSE);
443
signal_handler = gdm_signal_handler_new ();
444
gdm_signal_handler_set_fatal_func (signal_handler,
445
(GDestroyNotify)g_main_loop_quit,
447
gdm_signal_handler_add_fatal (signal_handler);
448
gdm_signal_handler_add (signal_handler, SIGTERM, signal_cb, NULL);
449
gdm_signal_handler_add (signal_handler, SIGINT, signal_cb, NULL);
450
gdm_signal_handler_add (signal_handler, SIGFPE, signal_cb, NULL);
451
gdm_signal_handler_add (signal_handler, SIGHUP, signal_cb, NULL);
452
gdm_signal_handler_add (signal_handler, SIGUSR1, signal_cb, NULL);
412
g_unix_signal_add (SIGTERM, on_shutdown_signal_cb, main_loop);
413
g_unix_signal_add (SIGINT, on_shutdown_signal_cb, main_loop);
414
g_unix_signal_add (SIGHUP, on_sighup_cb, NULL);
415
g_unix_signal_add (SIGUSR1, on_sigusr1_cb, NULL);
454
417
if (do_timed_exit) {
455
418
g_timeout_add_seconds (30, (GSourceFunc) timed_exit_cb, main_loop);