Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 651212 - net-analyzer/smokeping-2.7.3 files/smokeping.init.5 command_args="--nodaemon" stops smokeping from logging events
Summary: net-analyzer/smokeping-2.7.3 files/smokeping.init.5 command_args="--nodaemon"...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CVE-2017-20147
  Show dependency tree
 
Reported: 2018-03-23 00:31 UTC by nic
Modified: 2022-09-18 21:33 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nic 2018-03-23 00:31:55 UTC
The new init script packaged unstable smokeping-2.7.1.ebuild incorrectly sets the default "nodaemon" command argument. SmokePing will not generate syslog messages when ran with this flag.

This appears to have been done as a workaround ? For without that value passed in the init script smokeping crashes ;/


files/smokeping.init.5:
command_args="--nodaemon"


I have successfully "sudo su -s /bin/bash smokeping" and ran the command manually.

$ perl /usr/bin/smokeping 
Note: logging to syslog as local1/info.
Daemonizing /usr/bin/smokeping ...
creating /run/smokeping.pid: Permission denied


Confirming syslog events are being generated. (The pid creation issue could be suppressed by pathing it to the smokeping users home dir: /var/lib/smokeping -- would appreciate the insight on how to set that the correct way;)



Need to dig deeper into the init script logic for it's not clear to me yet what exit condition the nodaemon flag is masking.
Comment 1 nic 2018-03-26 16:06:57 UTC
The init script crash is related to the pid error smokeping throws; permission denied for that file is created with root:root ownership by start-stop-daemon.


I was able to get this working by removing these lines:

 command_args="--nodaemon"
 command_background="true"



Update the pid paths as /run/smokeping

/etc/init.d/someping
 pidfile="/run/smokeping/${RC_SVCNAME}.pid"

/etc/smokeping/config
 piddir = /run/smokeping




Borrowing logic from the previous init script to create the run pid dir, add this to start_pre()

 if [ ! -d /run/smokeping/ ]; then
   mkdir /run/smokeping/
 fi
 chown $command_user /run/smokeping/



That enabled smokeping to properly run in it's own daemon mode with syslog functionally, and suppress the errors generated by allowing it to create the pid file with smokeping:smokeping ownership.

Thanks ;)