Score:0

RootDirectory in systemd ignored?

vn flag

I am trying to execute service but result is "Failed to locate executable /usr/sbin/myservice: No such file or directory".

Service runs under chroot.

Service contains:

[Service]
RootDirectory=/chroot/myservice
RootDirectoryStartOnly=true
.
.
ExecStart=/usr/sbin/myservice -n -f /etc/rsyslog.d/myservice.conf
.
.

File is available in the path

ls -l /chroot/myservice/usr/sbin/myservice
lrwxrwxrwx 1 root root 18 Oct 28 14:52 /chroot/myservice/usr/sbin/myservice -> /usr/sbin/rsyslogd

ls -l /chroot/myservice/usr/sbin/rsyslogd
-rwxr-xr-x 1 root root 785600 May  2 20:45 /chroot/myservice/usr/sbin/rsyslogd

Systemd version

systemd 249 (249.11-0ubuntu3.6)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY -P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified

Service works fine under Debian10 or Ubuntu20 but cannot start it under Ubuntu 22.

I compared services where it run and doesn't with systemctl show command so I fixed some issues but I am stuck now.

eDonkey avatar
sl flag
Most probably it's SELINUX preventing you from executing the file, see [this post](https://unix.stackexchange.com/a/679879/512694).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.