<mdlayher>
the basic idea is that i'd like to differentiate service stop versus restart in my application by the signal that is sent from systemd. i had assumed this would provide TERM on stop and HUP on restart, but it seems not
<mdlayher>
and i want to do that because i want to make sure all the machines on my LAN don't drop their IPv6 default route when i'm doing an immediate service restart!
<Mic92>
mdlayher: in our activation script we usually stop and than start services rather than using restart.
<Mic92>
You could modify the service to reload instead.
<mdlayher>
yeah i was just thinking about that. i was hoping for a tidy solution leveraging systemd rather than having to propagate cancelation through my program, load a new config, validate it, deal with a possibly malformed config, etc etc etc. but perhaps i need to bite that bullet
<Mic92>
mdlayher: we use reload for nginx for the same reason.
<mdlayher>
i'll take a look at the module there for inspiration, thanks!
<Mic92>
mdlayher: have a look enableReload option there.
<Mic92>
I think in the long term we should have a pre-activation phase that does imperative configuration checkw
<Mic92>
*checks
<Mic92>
Not all checks can be executed in the sandbox.
<Mic92>
We don't want those on systemd-bootup though because it could render the system not booting
<Mic92>
*system bootup
<mdlayher>
yep makes sense
<Mic92>
But if one would do `switch` there could be a rollback if any of the checks fail.
<Mic92>
This would make many things easier.
<Mic92>
Basically in between setting up /etc and stopping the old services.
<Mic92>
But with an option to ignore failed checks or the upgrade could dead-lock like I have seen many times in apt.
<mdlayher>
i like this idea. is there an issue open about it that i could subscribe to? i'm happy to be a guinea pig for these sorts of changes
<Mic92>
mdlayher: No. It only exists in my head. I had this idea when working on https://github.com/Mic92/sops-nix because there keys could fail to decrypt, in which case one may not want to continue to boot.
<samueldr>
Mic92: yeah, I knew about the upgrade in staging, I was looking for the problem details to know whether what I was seeing was related or not (it was not related)
<aanderse>
"Mic92" (https://matrix.to/#/@freenode_Mic92:matrix.org): have you started any conversations on this? or all just in your mind currently?
<Mic92>
aanderse: the thing about configuration checks?
<Mic92>
you already found it.
<aanderse>
sorry i meant other than that thread :-)
<Mic92>
This issue is the first one about the topic.
<aanderse>
cool
<aanderse>
i look forward to seeing the conversation progress
<aanderse>
if there is anything more useful than "i like that too" that i can contribute please let me know
<Mic92>
aanderse: once there is a design how the rollback can work, it's all about integrating nixos services to have their configuration checks there.
<aanderse>
yeah
<Mic92>
I don't have a time line for it, but I want to have it for sops-nix.