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 700550 - fix logging under systemd
fix logging under systemd
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-0.9.10
 
 
Reported: 2013-05-17 19:43 UTC by Dan Winship
Modified: 2013-05-21 12:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main: make handling of --no-daemon saner by using G_OPTION_FLAG_REVERSED (1.50 KB, patch)
2013-05-17 19:43 UTC, Dan Winship
none Details | Review
main: add --debug, fix logging under systemd (5.05 KB, patch)
2013-05-17 19:43 UTC, Dan Winship
none Details | Review
core: add single-letter command-line flags (3.28 KB, patch)
2013-05-20 14:50 UTC, Dan Winship
none Details | Review

Description Dan Winship 2013-05-17 19:43:20 UTC
as discussed on irc, see second patch.

also danw/log branch
Comment 1 Dan Winship 2013-05-17 19:43:39 UTC
Created attachment 244575 [details] [review]
main: make handling of --no-daemon saner by using G_OPTION_FLAG_REVERSED
Comment 2 Dan Winship 2013-05-17 19:43:41 UTC
Created attachment 244576 [details] [review]
main: add --debug, fix logging under systemd

When run with --no-daemon, NM used to duplicate all syslog output to
stderr, for ease of debugging. But this meant it had to tell systemd
to ignore stderr, so you wouldn't get duplicated log entries. But that
meant we lost error messages that didn't go through nm_log. (eg,
g_warning()s and g_return_if_fail()s).

Fix this by making --no-daemon no longer duplicate syslog output to
stderr, and removing the "StandardError=null" from the systemd service
file. To get the old behavior, you can use --debug instead of
--no-daemon.
Comment 3 Pavel Simerda 2013-05-17 23:53:14 UTC
Would be nice to announce on the mailing list and possibly also include in release notes. I don't even mention the manual page. And please add a (uppercase) -D as an alias to --debug, if possible.
Comment 4 Dan Winship 2013-05-20 14:50:21 UTC
Created attachment 244802 [details] [review]
core: add single-letter command-line flags

Add single-letter options for --version, --no-daemon, --debug, and
--pid-file (and document them, as well as the existing single-letter
option for --help).
Comment 5 Pavel Simerda 2013-05-20 20:52:38 UTC
Review of attachment 244802 [details] [review]:

Nice. I just think more sensible alias for --version is -V (-v for --verbose) and -D for --debug (-d often has a different meaning). But these are cosmetics, of course.
Comment 6 Dan Winship 2013-05-20 21:54:56 UTC
Hm...

Running "foreach f in /bin/*; do $f --help ..."[*], I get:

  103 -d | --debug
  121 -d as debug (without also having --debug)
  621 -d as something else

   11 -D | --debug
    8 -D as debug
  174 -D as something else

  172 -v | --version
   18 -v as version
  259 -v as verbose
  233 -v as something else

  296 -V | --version
   22 -V as version
   25 -V as verbose
   56 -V as something else

So looks like you're right about version/verbose, and we should go with -V, but -d is better for debug.


[*] Kids, don't try this in $HOME!
Comment 7 Pavel Simerda 2013-05-21 09:25:32 UTC
(In reply to comment #6)
> So looks like you're right about version/verbose, and we should go with -V, but
> -d is better for debug.

Good, thanks!