Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 502550 - app-admin/salt - add USE=syslog
Summary: app-admin/salt - add USE=syslog
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-02-26 18:12 UTC by W. Trevor King
Modified: 2014-02-27 00:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch sketching out my suggested approach for the 9999 ebuild (salt-syslog.patch,1.96 KB, patch)
2014-02-26 18:30 UTC, W. Trevor King
Details | Diff
emerge --info from my app-admin/salt-0.17.4-r2 test (emerge-info,4.05 KB, text/plain)
2014-02-26 19:06 UTC, W. Trevor King
Details

Note You need to log in before you can comment on or make changes to this bug.
Description W. Trevor King 2014-02-26 18:12:24 UTC
Syslog logging was added in Salt v0.11.0 [1], but currently configuring Salt to use syslog fails is syslog is not running (or installed).

[1]: https://github.com/saltstack/salt/pull/2778

Reproducible: Always

Steps to Reproduce:
1. emerge -v =app-admin/salt
2. sed -i 's|^#\(log_file: file:///dev/log\)|\1|' /etc/salt/minion
3. sed -i 's|^\(#log_level_logfile:.*\)$|\1\nlog_level_logfile: info|' /etc/salt/minion
4. rc-service syslog-ng stop
5. rc-service salt-minion start

Actual Results:  
 * Starting SALT minion daemon ...
No handlers could be found for logger "salt.log.setup"
 * start-stop-daemon: failed to start `/usr/bin/salt-minion'
 * Failed to start salt-minion                                [ !! ]
 * ERROR: salt-minion failed to start


Expected Results:  
 * Starting syslog-ng ...             [ ok ]
 * Starting SALT minion daemon ...    [ ok ]


I'd suggest the Salt ebuild add 'syslog' to IUSE, and if that was set, add a virtual/logger RDEPEND and a 'need logger' clause to the init scripts' depend()s (for both the master and minion scripts).  The syslog use flag should be enabled by default, since Salt apparently tries to use syslog by default (and currently crashes as a result).
Comment 1 W. Trevor King 2014-02-26 18:30:27 UTC
Created attachment 371354 [details, diff]
Patch sketching out my suggested approach for the 9999 ebuild

This also bumps the 9999 ebuild to use the *-2 forms of the conf and init scripts, which were added for 0.17.4-r2.
Comment 2 W. Trevor King 2014-02-26 18:32:09 UTC
(In reply to W. Trevor King from comment #0)
> 1. emerge -v =app-admin/salt

Oops, I meant:

  emerge -v app-admin/salt

(without the leading '=').
Comment 3 W. Trevor King 2014-02-26 19:03:59 UTC
The:

  No handlers could be found for logger "salt.log.setup"

error from the original report was with Salt v2014.1.0 (installed via the live ebuild).  With app-admin/salt-0.17.4-r2 the rc start succeeds, but the minion crashes afterwards.  When I run the minion directly, I see the error message:

  # salt-minion       
  [ERROR   ] Failed to setup the Syslog logging handler: [Errno 111] Connection refused

I'll attach my emerge info for the 0.17.4-e2 install next.
Comment 4 W. Trevor King 2014-02-26 19:06:02 UTC
Created attachment 371356 [details]
emerge --info from my app-admin/salt-0.17.4-r2 test

Salt doesn't have a stable ebuild, so I also have:

  $ cat /etc/portage/package.accept_keywords 
  # required by app-admin/salt (argument)
  =app-admin/salt-0.17.4-r2 ~amd64
  # required by app-admin/salt-0.17.4-r2
  # required by app-admin/salt (argument)
  =dev-python/msgpack-0.4.1 ~amd64
  # required by app-admin/salt-0.17.4-r2
  # required by app-admin/salt (argument)
  =dev-python/pyyaml-3.10-r1 ~amd64
  # required by app-admin/salt-0.17.4-r2
  # required by app-admin/salt (argument)
  =dev-python/pycryptopp-0.6.0 ~amd64
Comment 5 Patrick McLean gentoo-dev 2014-02-27 00:03:08 UTC
I added a "use logger" to the init script for 2014.1.0, this will make sure that the logger is started before salt if it is enabled.

As syslog is only needed when enabled in the config file, not too many ebuilds actually depend on a logger since systems are generally not very useful without a logger anyway.
Comment 6 W. Trevor King 2014-02-27 00:17:37 UTC
(In reply to Patrick McLean from comment #5)
> I added a "use logger" to the init script for 2014.1.0, this will make sure
> that the logger is started before salt if it is enabled.

Works for me, thanks :).