NixOS systemd | 614 Members | |
| NixOS ❤️ systemd | 173 Servers |
| Sender | Message | Time |
|---|---|---|
| 4 Mar 2025 | ||
| 17:48:45 | ||
| 5 Mar 2025 | ||
| A while ago, I mentioned seeing an issue with runtime overrides not getting applied. Ran into this now again. I have a complex Caddy configuration that I'd like to debug "in vivo", so I copied the Caddy config from the store to a writable location, ran `systemctl edit --runtime caddy && systemctl daemon-reload && systemctl restart caddy", but a "ps | grep caddy" shows it's still referrencing the old config path. I made sure to "reset" A that's happening with 257.2 - anyone else ran into something like this? | 10:39:10 | |
| is this potentially caused by the fact, that the Caddy module itself already throws an override at Caddy? | 10:42:37 | |
| No, that should not matter | 10:42:58 | |
| ah, I see... that's just the regular one in /etc/static/systemd/system/caddy.service.d/, but systemd's display of the realpath instead of the symlink is what confused me.... | 10:44:13 | |
| might have strace PID#1 to get to the bottom of this… this will be "fun" 😒 | 10:45:23 | |
might have to strace PID#1 to get to the bottom of this… this will be "fun" 😒 | 10:46:12 | |
I should probably not use -f on strace in this case 🤦 | 10:48:02 | |
| hmm, according to strace, it reads the runtime override before the on from the Nix store... I'll have to dig through the codebase now to see, whether "order of reading" == "order of evaluation" | 10:55:33 | |
| hmm, according to strace, it reads the runtime override before the one from the Nix store... I'll have to dig through the codebase now to see, whether "order of reading" == "order of evaluation" | 10:55:42 | |
| can't make any sense of it... implementation looks correct to me | 11:42:51 | |
| iirc systemd priority is /etc -> /run -> /usr, so runtime overrides don't override /etc (for some reason) | 12:08:45 | |
| oh, that'd render runtime overrides completely pointless for most NixOS services... double-checking the sd docs | 13:22:08 | |
| I don't think that's how it works | 13:22:30 | |
| /run should win | 13:22:32 | |
| You'd think so | 13:24:45 | |
| That would be the sensible and intuitive design | 13:25:11 | |
| From the docs:
| 13:31:11 | |
But looking at the table in "Unit File Load Path", it might be possible to use /run/systemd/transient instead… | 13:33:29 | |
unfortunately, systemctl edit doesn't understand --transient, so this has to be handled manually…but we might want to rework the patch 0016-systemctl-edit-suggest-systemdctl-edit-runtime-on-sy.patch pointing people towards --runtime | 13:35:35 | |
| Yeah, I ran into this in the past as well, /etc takes priority over /run, unfortunately. I didn't know about the transient stuff | 15:26:12 | |
| I don't think you're supposed to use the transient stuff for this, I think it's what's used by systemd-run | 15:27:44 | |
| Would anyone be willing to help me figure out how to combine the two glitchtip services and the glitchtip.socket so that they all reside under /run/glitchtip and don't delete the socket on themselves and restarting one doesn't leave the socket missing? I tried copying from paperless but it doesn't fully work yet. https://github.com/SuperSandro2000/nixpkgs/commit/f1bb998afa34c6fa46236370d72c1d1904a41f34 | 15:52:13 | |
| Dont. You shouldn't put sockets in RuntimeDirectory | 16:02:26 | |
| Sockets go in /run (top-level) | 16:02:32 | |
| RuntimeDirectory is private to the service. A socket is per definition something to be shared. Don't put it in RuntimeDirectory | 16:03:05 | |
| There is RuntimeDirectoryPreserve as a workaround | 16:03:33 | |
| But usually it's the wrong choice to put a socket managed by a .socket. In a directory managed by a .service | 16:03:53 | |
| Also bad eg: you cannot bind mount them then because on restart the bind mount breaks | 16:04:30 | |
| it works for paperless already, so I guess it cannot be to bad | 16:04:50 | |