this post was submitted on 04 Jul 2024
17 points (94.7% liked)
Linux 101 stuff. Questions are encouraged, noobs are welcome!
1060 readers
2 users here now
Linux introductions, tips and tutorials. Questions are encouraged. Any distro, any platform! Explicitly noob-friendly.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Typically you instruct systemd to run a service as a specific user/group with a User= and Group= directive in the [Service] section of the unit file.
The error code indicates the command is found but is not executable.
Is this service running under your user context? Generally when I am building a system service I put it under /etc/systemd/system and it runs as root without issues unless I specify.
The service is in that folder, but it's not automatically assuming to run as root. Maybe it's an SELinux thing, since this is on Bazzite...?
Either way, I tried adding
And it's still throwing that 126. It's definitely executable, but maybe it's not a bash script, though I dunno what else you'd use to run it. To manually start it, you just type
sudo /path/to/daemon
(no file extension).Edit: definitely not a bash script. Kate can't read it. It looks like it's some kind of pre-compiled binary.
Does the service include execute permission for the root user or group? Unsure if root user or group can be blocked from permissions or not, but do you have chmod +x and the service is owned by root and/or the x is in the “everyone” place?
Root is required, but it's already an executable binary, not a script.
chmod +x
andchmod 755
both had no effect on the 126.Fortunately, it was solved by adding
/usr/bin/env
to the ExecStart line. According to another user, the default environment is limited, so the script was probably looking for some specific environment variables, whichenv
can provide.Normally, this would be set up by default with the installation script, but I'm trying to set this up on Bazzite, so there's some problematic issues to overcome.