FS#38584 - [libalpm] UseSyslog requires LogFile be openable
Attached to Project:
Pacman
Opened by Zachary Cook (Zeik) - Monday, 20 January 2014, 08:01 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 05 February 2014, 18:16 GMT
Opened by Zachary Cook (Zeik) - Monday, 20 January 2014, 08:01 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 05 February 2014, 18:16 GMT
|
Details
Description:
The UseSyslog option in pacman.conf will only function correctly if libalpm can open the logfile specified by the LogFile option. This prevents using just the syslog/journal for logging and also the use of syslog as a fallback for when logging to LogFile fails. Looking at the source it seems lib/libalpm/log.c:alpm_logaction returns before sending to syslog in lib/libalpm/util.c:_alpm_logaction, if there was a problem opening handle->logfile. Additional info: * package version: 4.1.2-5 Steps to reproduce: -Uncomment UseSyslog and set LogFile to an empty string: no more syslog output from pacman. |
This task depends upon
I did not test with /dev/null before, and it actually seems to work fine already with UseSyslog, so syslog is supported as a standalone log destination already.
Therefore this bug is a lot less important, as it only causes secondary logging to fail when the primary logging destination fails.
If it is wanted, attached is a patch to make syslog work even with LogFile being invalid/unopenable, but it makes the code a bit more messy.