Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 509548 - tracking of start and reload times
Summary: tracking of start and reload times
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-04 14:38 UTC by Jaco Kroon
Modified: 2014-07-05 20:58 UTC (History)
0 users

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


Attachments
lsof-check (lsof-check,7.82 KB, text/plain)
2014-05-05 21:19 UTC, Christian Ruppert (idl0r)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2014-05-04 14:38:33 UTC
It would be really handy if openrc was able to display the times at which a service was started, and when last reload was issued.

In a way I can track if/when a service was started by looking in /proc/${pid_of_daemon}/ but that is cumbersome, and requires knowing which pid represents which daemon, where if openrc tracked things could have consistent output/display of the information and it would be trivial to track reload times too.

Motivation:  I've got a tool currently that can determine if services needs to be restarted based on whether libraries has been upgraded etc, but I would like to add simple reloads reliably.  Currently it can mostly get it right by tracking reload times of reloads that it performs itself, and by comparing ctimes of config files/folders (with symlink tracking), however, this may perform spurious reloads in quite a number of cases, the above functionality from OpenRC would enable me to modify the tool to use those times instead (I know some daemons have other ways of reloading, eg, request via webui etc ... but I'm not too worried about those - I personally generally use the init scripts to achieve reloads - where the init scripts support reload anyway).

Reproducible: Always
Comment 1 Christian Ruppert (idl0r) gentoo-dev 2014-05-05 21:19:04 UTC
Created attachment 376442 [details]
lsof-check

I'm not sure what you're trying but what you want to do sounds more complicated than it actually is.
Take a look at the attached lsof-check script.
Comment 2 Christian Ruppert (idl0r) gentoo-dev 2014-05-05 21:30:47 UTC
So, I guess they way I do it there is your solution. If there's anything unclear  feel free to ask. Right know I don't think we'll add this feature.
Comment 3 Jaco Kroon 2014-05-06 13:15:46 UTC
Hi Christian,

Thanks for your response, I can see that you put quite some work into it.

The lsof-check script does exactly what I've already got (the restart portion for binaries/libraries replaced portion).  I can already track when config files changed, and when services started (/proc/ is awesome), but I can't track when services got reloaded.  Ala /etc/init.d/${servicename} reload.  If I can do that I can compare the config-change times with the latest restart/reload time and if the config files changed after issue another reload.
Comment 4 William Hubbs gentoo-dev 2014-06-24 18:52:52 UTC
Another consideration is that reload is not supported natively by OpenRC
and must be defined in the service script if the service supports it.

I agree with Christian; I do not see us adding this feature.