Closed JackNewman12 closed 1 year ago
Nice catch, thanks!
Dunno why one of the tests fail. Running the same patch on my local system is 100% success. So I'm merging this and moving on to the next PR. If the test issue remains I'll have a look at that separately, because your patch is sound regardless.
This fixes
initctl reload
correctly restarting all daemons that have new command line arguments. Previously command line arguments changes were only acted upon if the service was explicitly reloaded usinginitctl reload myservice
since it blindly sets thesvc->dirty
flag.When checking if a service should be restarted,
svc_is_changed()
checks for thesvc->dirty
flag, and then only after that willsvc_sighup()
look for thesvc->args_dirty
flag. Hence a difference in command line arguments would not result in a service being restarted. https://github.com/troglobit/finit/blob/9887003b25355c94c46e05985b9738297df6f1a8/src/service.c#L2289-L2293You could also add the
|| svc->args_dirty
check into thesvc_is_changed()
, but I think it makes sense this way.