Dan Kenigsberg has submitted this change and it was merged.

Change subject: debug: Make it easy to debug start failures
......................................................................


debug: Make it easy to debug start failures

If Vdsm fail to start before logging was configured, it used to log a
message to syslog and exit silently. This make it hard to debug from the
shell.

This patch raises FatalError in the places that used to log to syslog
and exit.  In the exception handler we log to syslog and re-raise the
exception, so the traceback is available in the shell, or in systemd
journal.

For example, instead of:

    # /usr/share/vdsm/vdsm
    (no output)

We get now:

    # /usr/share/vdsm/vdsm
    Traceback (most recent call last):
      File "/usr/share/vdsm/vdsm", line 271, in <module>
        main()
      File "/usr/share/vdsm/vdsm", line 253, in main
        __assertVdsmUser()
      File "/usr/share/vdsm/vdsm", line 230, in __assertVdsmUser
        % (constants.VDSM_USER, username))
    __main__.FatalError: Not running as 'vdsm', trying to run as 'root'

In the system log we will see this message:

    Aug 11 20:58:34 hostname vdsm: VDSM failed to start: Not running as
    'vdsm', trying to run as 'root'

Change-Id: I7c47e289ce4d7d043d8d95887a3d645797270944
Signed-off-by: Nir Soffer <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/44728
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <[email protected]>
Reviewed-by: Piotr Kliczewski <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M vdsm/vdsm
1 file changed, 23 insertions(+), 16 deletions(-)

Approvals:
  Piotr Kliczewski: Looks good to me, but someone else must approve
  Nir Soffer: Verified
  Jenkins CI: Passed CI tests
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Looks good to me, but someone else must approve



-- 
To view, visit https://gerrit.ovirt.org/44728
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7c47e289ce4d7d043d8d95887a3d645797270944
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: [email protected]
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to