Safe-Reload: Support command line argv - #8973
Conversation
Al2Klimov
left a comment
There was a problem hiding this comment.
The other PR removed the first array item, then used the leftovers. Any way to just slice the array à la Golang?
|
Actually it does have a way and that is the following |
|
Colleagues, is it reasonable to require bash? |
|
What's the problem with just using shift? Does the job and works in a POSIX shell. Also, would the proper way to set |
Good point! #7349 would do that better (but lacks feedback, yet). |
|
I think this could be a valid solution as well, given that the daemon itself also checks the config before performing the actual reload. So we could possibly just get rid of the |
|
And we'd get 2x speed! |
|
... btw. on every reload via systemctl: |
Al2Klimov
left a comment
There was a problem hiding this comment.
I'd prefer a shell array here.
julianbrost
left a comment
There was a problem hiding this comment.
Quoting is definitely broken in the current version.
I'd prefer a shell array here.
That would require switching from sh to bash for this file.
Shouldn't shift be enough to get rid of the entire loop?
I could live with that unless...
|
|
|
Under the premise that the signature of the The fundamental question is how to add extra command line arguments to the ExecStart=/usr/sbin/icinga2 daemon --close-stdio -e ${ICINGA2_ERROR_LOG}
ExecReload=/usr/lib/icinga2/safe-reload /etc/default/icinga2Into something like this: ExecStart=/usr/sbin/icinga2 daemon --close-stdio -e ${ICINGA2_ERROR_LOG} -DFoo=Bar
ExecReload=/usr/lib/icinga2/safe-reload /etc/default/icinga2 -DFoo=BarWhere the change to the second line is totally non-obvious and will likely be missed resulting in surprising behavior. If that behavior doesn't immediately result in an error, it might just go unnoticed (but also things won't work as expected), otherwise it results in some annoying debugging. Also looks like we're going in circles here: my comment #8973 (comment) still fully applies. So with the other idea from that comment, the ExecStart=/usr/sbin/icinga2 daemon --close-stdio -e ${ICINGA2_ERROR_LOG} $DAEMON_ARGS
ExecReload=/usr/lib/icinga2/safe-reload /etc/default/icinga2This would immediately hint that you can add custom arguments in that variable and if you set it (either in One alternative could be – if systemd supports it – something like Another alternative would indeed be something like #7349 as this would remove the need for |
|
Quick? Indeed not. But an additional benefit you din't mention is 2x shorter reload time due to only one validation and no race condition inbetween the two. Also the caller would get feedback about reload success. Do we agree that #7349 just rocks 🪨🪨 (conceptionally)? |
Only for reloads triggered from systemd or init.d. Config deployments using the config package API not affected by this.
How would that differ? Isn't that pretty much the purpose of the
Getting rid of an extra config validation that's just done to obtain the output from it when the same can be obtained from the actual config load during the reload is ultimately a good idea. But that PR isn't close to being ready to be merged. Just using |
|
|
FWIW, /etc/systemd/system/postgresql.service does exactly that on NixOS. I mean, if they're fine with it...
CC @oxzi |
|
No progress has been made on this for years, so I'm closing it. |
resolves #8911
refs #8971