Commit df37a832 authored by Colin Walters's avatar Colin Walters

Set up systemd journal redirection after early option processing

And don't do it if --debug is passed.  This makes --help work, and
avoiding it with --debug should help gnome-settings-daemon's test
suite.

https://bugzilla.gnome.org/show_bug.cgi?id=703661
parent 7b15205d
......@@ -296,18 +296,6 @@ main (int argc, char **argv)
gsm_util_init_error (TRUE, "%s", error->message);
}
#ifdef HAVE_SYSTEMD
{
int journalfd;
journalfd = sd_journal_stream_fd (PACKAGE, LOG_INFO, 0);
if (journalfd >= 0) {
dup2(journalfd, 1);
dup2(journalfd, 2);
}
}
#endif
/* Check GL, if it doesn't work out then force software fallback */
if (!check_gl (&error)) {
gl_failed = TRUE;
......@@ -346,6 +334,22 @@ main (int argc, char **argv)
exit (0);
}
/* Rebind stdout/stderr to the journal explicitly, so that
* journald picks ups the nicer "gnome-session" as the program
* name instead of whatever shell script GDM happened to use.
*/
#ifdef HAVE_SYSTEMD
if (!debug) {
int journalfd;
journalfd = sd_journal_stream_fd (PACKAGE, LOG_INFO, 0);
if (journalfd >= 0) {
dup2(journalfd, 1);
dup2(journalfd, 2);
}
}
#endif
if (gl_failed) {
gsm_fail_whale_dialog_we_failed (FALSE, TRUE, NULL);
gtk_main ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment