!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

619 Members
NixOS ❤️ systemd173 Servers

Load older messages


SenderMessageTime
19 Feb 2025
@arianvp:matrix.orgArianRun the `systemd-path` executable. You'll immediately understand the cyclic dependency due to the output it prints 14:21:36
@sss:matrix.dark-alexandr.netsss 20:06:14
20 Feb 2025
@thursdaddy:matrix.orgthursdaddy set a profile picture.00:14:02
21 Feb 2025
@cleverca22:matrix.orgcleverca22having to fight systemd recovery mode today somebody setup fstab to mount a device that didnt exist, on a headless machine systemd had a panic attack, and refused to run ssh until somebody logged in on the "physical terminal" with the root pw (none was set), so the machine was basically bricked for 5 months, lol05:06:44
@cleverca22:matrix.orgcleverca22 i know i can just set options = [ "nofail" ]; but then it just entirely ignores the mount-point, and starts services on the wrong disk 05:07:17
@cleverca22:matrix.orgcleverca22how can i make systemd not have a total panic attack, but also not start certain services?05:07:35
@elvishjerricco:matrix.orgElvishJerricco cleverca22: You can use x-systemd.required-by=sshd.service,x-systemd.before=sshd.service as file system options 05:59:33
@elvishjerricco:matrix.orgElvishJerricco see the systemd.mount manpage 05:59:43
@elvishjerricco:matrix.orgElvishJerricco but x-systemd.required-by=sshd.service will basically remove the normal dependencies and just make the mount a dependency of sshd.service 06:00:07
@elvishjerricco:matrix.orgElvishJerricco (sshd was a bad example because I think that's the opposite of what you want but I think you get the point :P) 06:00:37
@elvishjerricco:matrix.orgElvishJerricco x-systemd.required-by= will make it so that the mount is not required by loca-fs.target, but instead just by the value of the option 06:01:41
@elvishjerricco:matrix.orgElvishJerriccomeaning if it fails, it won't send the system to emergency mode06:01:54
@elvishjerricco:matrix.orgElvishJerricco but of course a required-by relationship isn't an ordering relationship, hence why I also mentioned x-systemd.before= 06:02:38
@cleverca22:matrix.orgcleverca22 ElvishJerricco: ah, RequiresMountsFor is what i wanted, and does work 06:09:18
@cleverca22:matrix.orgcleverca22 but only if its in unitConfig, doh 06:09:23
@cleverca22:matrix.orgcleverca22 service.d/overrides.conf:18: Unknown key name 'RequiresMountsFor' in section 'Service', ignoring. 06:09:34
@elvishjerricco:matrix.orgElvishJerricco cleverca22: Sure, though that requires adding nofail to the file system if you want it to not cause emergency mode 06:10:05
@cleverca22:matrix.orgcleverca22yep, i already added nofail, and that caused an issue of the service starting without the disk06:12:43
@cleverca22:matrix.orgcleverca22 nofail plus RequiresMountsFor results in no emergency mode, and the service doesnt start 06:13:01
@cleverca22:matrix.orgcleverca22 Feb 21 06:10:16 backend1 systemd[1]: ipfs.service: Job ipfs.service/start failed with result 'dependency'. 06:13:32
@cleverca22:matrix.orgcleverca22thats perfect06:13:35
@elvishjerricco:matrix.orgElvishJerricco yea, that's nearly the same thing as simply adding x-systemd.required-by=foo.service,x-systemd.before=foo.service, with the only difference being that my way doesn't mount the file system if foo.service isn't scheduled at boot. 06:15:29
@cleverca22:matrix.orgcleverca22under normal conditions, it should mount at boot, and start the service at boot06:19:59
@elvishjerricco:matrix.orgElvishJerriccoyea, the difference is negligible06:20:12
@cleverca22:matrix.orgcleverca22 the problem, is that somebody put the fileSystems config in a shared module
and then deployed it to a dev machine in digital ocean
a machine lacking the DO volume....
06:20:26
@elvishjerricco:matrix.orgElvishJerriccoit would only matter if you wanted to mask the service for some reason06:20:27
@cleverca22:matrix.orgcleverca22so the machine instantly fell over06:20:32
@cleverca22:matrix.orgcleverca22and nobody bothered fixing it, for 5 months06:20:39
@elvishjerricco:matrix.orgElvishJerriccoIt'll mount at normally boot with either way06:21:28
@elvishjerricco:matrix.orgElvishJerricco but the x-systemd. way would not mount if you masked the service for some reason 06:21:54

Show newer messages


Back to Room ListRoom Version: 6