Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make munge log to syslog #943

Closed
jabl opened this issue Mar 9, 2019 · 3 comments
Closed

Make munge log to syslog #943

jabl opened this issue Mar 9, 2019 · 3 comments
Milestone

Comments

@jabl
Copy link
Contributor

jabl commented Mar 9, 2019

By default munge writes logs by itself to /var/long/munge/munged.log. This prevents those logs from being forwarded to the log server (e.g. the OpenHPC SMS/admin machine), and in case those logs for one reason or another grows rapidly (e.g. dun/munge#26 ) it can be a problem for diskless nodes (or compute nodes with small partitions where /var/log reside).

Fortunately, munge has an option to instead log to syslog, --syslog, which would solve this problem. To add this option, there's a couple of options

  • Just add --syslog to the ExecStart line in /usr/lib/systemd/system/munge.service

  • The munge package has /etc/sysconfig/munge but that isn't actually used anymore since the systemd service file doesn't specify to load environment variables from there. To do this, one could add --syslog to a default DAEMON_OPTS, and add a "EnvironmentFile=-/etc/sysconfig/munge" directive to /usr/lib/systemd/system/munge.service. Apparently upstream is planning something like this in specify daemon options with systemd unit file dun/munge#64

@koomie
Copy link
Contributor

koomie commented Mar 11, 2019

This seems look a reasonable idea to me to have it go to syslog. Want to try creating a PR for this change to the ohpc build of munge?

@jabl
Copy link
Contributor Author

jabl commented Mar 11, 2019

Sure, lets see...

jabl added a commit to jabl/ohpc that referenced this issue Mar 11, 2019
By default munge writes logs by itself to
/var/long/munge/munged.log. This prevents those logs from being
forwarded to the log server (e.g. the OpenHPC SMS/admin machine), and
in case those logs for one reason or another grows rapidly (e.g.
dun/munge#26) it can be a problem for
diskless nodes or compute nodes with small partitions for /var/log.

This should fix openhpc#943

Signed-off-by: Janne Blomqvist <[email protected]>
@koomie koomie added this to the 1.3.7 milestone Mar 13, 2019
@koomie
Copy link
Contributor

koomie commented Mar 13, 2019

Thanks! With your patch and slight tweak to apply it, we should now have munge dumping to syslog. Example from CI environment:

# grep munge /var/log/messages 
Mar 12 22:54:57 c2 munged[8659]: Running on "c2.localdomain" (172.16.1.18)
Mar 12 22:54:57 c2 munged[8659]: PRNG seeded with 128 bytes from "/dev/urandom"
Mar 12 22:54:57 c2 munged[8659]: Enabled PRNG entropy pool enhanced stirring
Mar 12 22:54:57 c2 munged[8659]: Updating supplementary group mapping every 3600 seconds
Mar 12 22:54:57 c2 munged[8659]: Enabled supplementary group mtime check of "/etc/group"
Mar 12 22:54:57 c2 munged[8659]: Starting munge-0.5.13 daemon (pid 8659)
Mar 12 22:54:57 c2 munged[8659]: Created 2 work threads
Mar 12 22:54:57 c2 munged[8659]: Found 4 users with supplementary groups in 0.001 seconds
Mar 12 22:54:58 c1 munged[8664]: Running on "c1.localdomain" (172.16.1.17)
Mar 12 22:54:58 c1 munged[8664]: PRNG seeded with 128 bytes from "/dev/urandom"
Mar 12 22:54:58 c1 munged[8664]: Enabled PRNG entropy pool enhanced stirring
Mar 12 22:54:58 c1 munged[8664]: Updating supplementary group mapping every 3600 seconds
Mar 12 22:54:58 c1 munged[8664]: Enabled supplementary group mtime check of "/etc/group"
Mar 12 22:54:58 c1 munged[8664]: Starting munge-0.5.13 daemon (pid 8664)
Mar 12 22:54:58 c1 munged[8664]: Created 2 work threads
Mar 12 22:54:58 c1 munged[8664]: Found 4 users with supplementary groups in 0.001 seconds
Mar 12 22:58:49 sms019 munged[69247]: Running on "sms019" (172.16.1.19)
Mar 12 22:58:49 sms019 munged[69247]: PRNG seeded with 128 bytes from "/dev/urandom"
Mar 12 22:58:49 sms019 munged[69247]: Enabled PRNG entropy pool enhanced stirring
Mar 12 22:58:49 sms019 munged[69247]: Updating supplementary group mapping every 3600 seconds
Mar 12 22:58:49 sms019 munged[69247]: Enabled supplementary group mtime check of "/etc/group"
Mar 12 22:58:49 sms019 munged[69247]: Starting munge-0.5.13 daemon (pid 69247)
Mar 12 22:58:49 sms019 munged[69247]: Created 2 work threads
Mar 12 22:58:49 sms019 munged[69247]: Found 4 users with supplementary groups in 0.001 seconds

@koomie koomie closed this as completed Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants