troglobit / finit

Fast init for Linux. Cookies included
https://troglobit.com/projects/finit/
MIT License
622 stars 61 forks source link

pidfile plugin debug spam #345

Closed JackNewman12 closed 1 year ago

JackNewman12 commented 1 year ago

I noticed on our system when doing initctl debug that we see a huge amount of spam. I assumed this was normal until I ran this on my machine at home (with a lot less services) and noticed it was quiet.

Jan 17 14:54:54.742 debug finit generic_io_cb():Calling I/O pidfile from runloop...
Jan 17 14:54:54.746 debug finit generic_io_cb():Calling I/O pidfile from runloop...
Jan 17 14:54:54.750 debug finit generic_io_cb():Calling I/O pidfile from runloop...
Jan 17 14:54:54.753 debug finit generic_io_cb():Calling I/O pidfile from runloop...
Jan 17 14:54:54.758 debug finit generic_io_cb():Calling I/O pidfile from runloop...
Jan 17 14:54:54.769 debug finit generic_io_cb():Calling I/O pidfile from runloop...
Jan 17 14:54:54.774 debug finit generic_io_cb():Calling I/O pidfile from runloop...
Jan 17 14:54:54.778 debug finit generic_io_cb():Calling I/O pidfile from runloop...
Jan 17 14:54:54.781 debug finit generic_io_cb():Calling I/O pidfile from runloop...
Jan 17 14:54:54.785 debug finit generic_io_cb():Calling I/O pidfile from runloop...
Jan 17 14:54:54.790 debug finit generic_io_cb():Calling I/O pidfile from runloop...

Looking at pidfile plugin it seems to add a number of watches for files, but there is one that triggers my spidy-senses in pidfile_init() that seems to setup a watch for /run. Is this then triggering on any modifications to files in /run?

https://github.com/troglobit/finit/blob/a47abfdc168a843ce81379805502cdd2f372b230/plugins/pidfile.c#L270-L281

If I get a chance I'll try a build without this line and see what happens.

JackNewman12 commented 1 year ago

Oh actually I guess this makes sense. Perhaps I might just need to disable the debug print.

troglobit commented 1 year ago

Yeah it runs for any file created in /run to track any .pid or foo/pid being created or removed. Maybe there should be a pidfile.c specific #ifdef PIDFILE_DEBUG or something, it's been bugging me too on occasion.