68
65
// delay on startup (to make session startup faster)
69
66
static int STARTUP_DELAY=1;
71
// make the release upgrader check for a devel release
72
gboolean DEVEL_RELEASE=FALSE;
74
// force release check
75
static gboolean FORCE_RELEASE_CHECK=FALSE;
77
68
// global debug options
78
69
static gboolean HOOK_DEBUG = FALSE;
79
70
static gboolean UPDATE_DEBUG = FALSE;
80
71
static gboolean INOTIFY_DEBUG = FALSE;
81
72
static gboolean UEVENT_DEBUG = FALSE;
82
static gboolean RELEASE_DEBUG = FALSE;
83
73
static gboolean MISC_DEBUG = FALSE;
97
87
g_log_default_handler (log_domain, log_level, message, user_data);
99
89
else if (log_domain && strcmp(log_domain, "inotify") == 0) {
101
91
g_log_default_handler (log_domain, log_level, message, user_data);
103
93
else if (log_domain && strcmp(log_domain, "uevent") == 0) {
105
95
g_log_default_handler (log_domain, log_level, message, user_data);
107
else if (log_domain && strcmp(log_domain, "release") == 0) {
109
g_log_default_handler (log_domain, log_level, message, user_data);
111
97
else if (MISC_DEBUG)
112
98
g_log_default_handler (log_domain, log_level, message, user_data);
256
242
g_debug_inotify("crashreport found");
257
243
un->crashreport_pending = TRUE;
259
if(strstr(info_uri, UNICAST_LOCAL_AVAHI_FILE)) {
260
g_debug_inotify("avahi disabled due to unicast .local domain");
261
un->unicast_local_avahi_pending = TRUE;
349
331
un->crashreport_pending = FALSE;
352
if(un->unicast_local_avahi_pending) {
353
g_debug("checking for disabled avahi due to unicast .local domain now");
354
avahi_disabled_check ();
355
un->unicast_local_avahi_pending = FALSE;
358
334
// reset the bitfields (for the next "time-slice")
359
335
un->dpkg_was_run = FALSE;
360
336
un->apt_get_running = FALSE;
358
gboolean autolaunch = g_settings_get_boolean(un->settings,
359
SETTINGS_KEY_AUTO_LAUNCH);
382
360
for(i=0;monitor_dirs[i] != NULL;i++) {
361
if (getenv("UPSTART_SESSION") && monitor_dirs[i] == CRASHREPORT_DIR && autolaunch) {
383
364
GError *error = NULL;
384
365
GFile *gf = g_file_new_for_path(monitor_dirs[i]);
385
366
monitor_handle = g_file_monitor_directory(gf, 0, NULL, &error);
394
375
"/var/lib/dpkg/status",
395
376
"/var/lib/update-notifier/dpkg-run-stamp",
396
377
"/var/lib/apt/periodic/update-success-stamp",
397
UNICAST_LOCAL_AVAHI_FILE,
399
379
for(i=0;monitor_files[i] != NULL;i++) {
400
380
GError *error = NULL;
522
502
{ "debug-updates", 0, 0, G_OPTION_ARG_NONE, &UPDATE_DEBUG, "Enable updates/autolaunch debugging"},
523
503
{ "debug-inotify", 0, 0, G_OPTION_ARG_NONE, &INOTIFY_DEBUG, "Enable inotify debugging"},
524
504
{ "debug-uevent", 0, 0, G_OPTION_ARG_NONE, &UEVENT_DEBUG, "Enable uevent debugging"},
525
{ "debug-new-release-check", 0, 0, G_OPTION_ARG_NONE, &RELEASE_DEBUG, "Enable new release check debugging"},
526
505
{ "debug-misc", 0, 0, G_OPTION_ARG_NONE, &MISC_DEBUG, "Enable uncategorized debug prints"},
527
506
{ "force", 0, 0, G_OPTION_ARG_NONE, &FORCE_START, "Force start even if the user is not in the admin group"},
528
507
{ "force-use-pkexec", 0, 0, G_OPTION_ARG_NONE, &FORCE_PKEXEC, "Force running all commands (update-manager, synaptic) with pkexec" },
529
508
{ "startup-delay", 0, 0, G_OPTION_ARG_INT, &STARTUP_DELAY, "Delay startup by given amount of seconds" },
530
{ "devel-release", 0, 0, G_OPTION_ARG_NONE, &DEVEL_RELEASE, "Make the release checker check for a new development release" },
531
{ "force-release-check", 0, 0, G_OPTION_ARG_NONE, &FORCE_RELEASE_CHECK, "Force release check" },
553
530
textdomain(PACKAGE);
555
532
if (HOOK_DEBUG || UPDATE_DEBUG || INOTIFY_DEBUG ||
556
UEVENT_DEBUG || RELEASE_DEBUG || MISC_DEBUG)
533
UEVENT_DEBUG || MISC_DEBUG)
557
534
g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
559
536
// setup a custom debug log handler
565
542
debug_log_handler, NULL);
566
543
g_log_set_handler ("uevent", G_LOG_LEVEL_DEBUG,
567
544
debug_log_handler, NULL);
568
g_log_set_handler ("release", G_LOG_LEVEL_DEBUG,
569
debug_log_handler, NULL);
570
545
g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG,
571
546
debug_log_handler, NULL);
588
// do not run as system user (e.g. guest user)
589
if (FORCE_RELEASE_CHECK)
590
g_settings_reset(un->settings, SETTINGS_KEY_LAST_RELEASE_CHECK);
592
563
// check if it is running already
593
564
if (!up_get_clipboard ()) {
594
565
g_warning ("already running?");
607
578
g_timeout_add_seconds(STARTUP_DELAY,
608
579
(GSourceFunc)(tray_icons_init), un);
610
// initial check for avahi
611
avahi_disabled_check();
613
/* setup inserted-cdroms checker */
614
if(!cdroms_init(un)) {
615
g_warning("initializing cdroms failed");
618
// init release checker
619
release_checker_init(un);
621
// init uevent monitoring (missing firmware, etc.)
581
// init uevent monitoring (printer support, etc.)
624
585
// init gio file monitoring
625
586
monitor_init (un);