After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703661 - [PATCH] main: If we have systemd, initialize journal here
[PATCH] main: If we have systemd, initialize journal here
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on: 699785
Blocks:
 
 
Reported: 2013-07-05 14:54 UTC by Bastien Nocera
Modified: 2013-07-08 15:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Set-up-systemd-journal-redirection-after-early-optio.patch (1.99 KB, patch)
2013-07-05 21:17 UTC, Colin Walters
reviewed Details | Review

Description Bastien Nocera 2013-07-05 14:54:19 UTC
+++ This bug was initially created as a clone of Bug #699785 +++

This is very broken.

gnome-session --help's output goes to /var/log/messages (?!) and this makes it impossible to capture gnome-session's output from test suites, such as the one in gnome-settings-daemon.

I understand we want the maximum amount of output/debug going to the journal in those cases, but this is a bit over the top.
Comment 1 Bastien Nocera 2013-07-05 14:55:24 UTC
This breaks the "test_forced_logout" test in gnome-settings-daemon.

======================================================================
FAIL: test_forced_logout (__main__.PowerPluginTest)
Test forced logout
----------------------------------------------------------------------
Traceback (most recent call last):
  • File "./test.py", line 711 in test_forced_logout
    self.check_for_logout(idle_delay + 2)
  • File "./test.py", line 214 in check_for_logout
    self.fail('timed out waiting for gnome-session logout call')
AssertionError: timed out waiting for gnome-session logout call

----------------------------------------------------------------------

The gnome-session log (from stdout) is completely devoid of content.
Comment 2 Colin Walters 2013-07-05 21:17:06 UTC
Created attachment 248491 [details] [review]
0001-Set-up-systemd-journal-redirection-after-early-optio.patch
Comment 3 Bastien Nocera 2013-07-08 08:32:10 UTC
Review of attachment 248491 [details] [review]:

Works for me, a shame that it wouldn't log the GTK+ init failure to the journal for example but I see no easy way around that (maybe an envvar to set the debug? we initialise GLib/GObject in check_gl() already)
Comment 4 Colin Walters 2013-07-08 12:32:03 UTC
(In reply to comment #3)
> Review of attachment 248491 [details] [review]:
> 
> Works for me, a shame that it wouldn't log the GTK+ init failure to the journal
> for example but I see no easy way around that (maybe an envvar to set the
> debug? we initialise GLib/GObject in check_gl() already)

Yeah...a more elegant fix I think is going to have to wait until we figure out how to make GLib out of the box do the right thing.

We could provide you a command line option (--enable-testing-mode?)  It's a little wrong to hook it off --debug as I have now because gdm will inject that if you enable Debug=true in gdm.conf.
Comment 5 Ray Strode [halfline] 2013-07-08 15:26:16 UTC
(In reply to comment #3)
> Review of attachment 248491 [details] [review]:
> 
> Works for me, a shame that it wouldn't log the GTK+ init failure to the journal
> for example but I see no easy way around that (maybe an envvar to set the
> debug? we initialise GLib/GObject in check_gl() already)

Can we do the dup2(journalfd, 2) early and the dup2(journalfd, 1) late?