[systemd-devel] ReadWriteDirectories directive in service file?

Bruce A. Johnson bjohnson at blueridgenetworks.com
Thu Jun 11 15:39:27 UTC 2020


I'm trying to figure out how to resolve these errors that are preventing
one of my services from running, and I'm kind of at a loss. Systemd is
stumbling over a read-write directory that needs to be created for the
service.

> Jun 04 09:44:03 url-000db95361f2 systemd[3819]: rl-web.service: Failed
> to set up mount namespacing: /run/systemd/unit-root/run/rl-web/tmp: No
> such file or directory
> Jun 04 09:44:03 url-000db95361f2 systemd[3819]: rl-web.service: Failed
> at step NAMESPACE spawning /bin/sh: No such file or directory

Under systemd 234, the service worked, but my team is now trying to get
together a newer OpenEmbedded build based on OE's dunfell branch, and
systemd is now 244 (244.3+). It is quite possible that we have got a few
things wrong, but it's a case of the nearsighted leading the blind.

I cannot find the /ReadWriteDirectory/ directive I used in my original
service file in the current systemd documentation. I tried replacing it
with /ReadWritePaths/ and threw in /ProtectSystem=True/. (The original
service file is below.)

Namespaces support is turned on in the kernel config.

The file /bin/sh mentioned in the log message is a symbolic link to
/bin/busybox.nosuid, which exists and has mode 0755. The busybox version
is 1.31.1.

The RuntimeDirectory is being created, and the pre-exec start script is
populating the directory with the rest of the files as expected.

Can anyone give me a suggestion of what else I need to check?

Thanks!

-- 

Bruce A. Johnson
Herndon, Virginia
USA

------------------------------------------------------------------------

Original service file:

[Unit]
Description=RL Web Service
After=rl-manager.service
Requires=rl-manager.service
PartOf=rl-manager.service

[Service]
EnvironmentFile=/var/run/rl-config/env
EnvironmentFile=/ubg/rl_manager_platform.env
Type=simple
RuntimeDirectory=rl-web
ReadWriteDirectories=/run/rl-web/tmp
ExecStartPre=/bin/sh /usr/sbin/rl_web_setup start
ExecStart=/usr/bin/stdbuf -o 0 -e 0 /usr/bin/python -m rl.webapp -d /run/rl-web
SyslogIdentifier=rl-web
ExecStartPost=/bin/sh /usr/sbin/rl_web_setup stop
Restart=on-failure

[Install]
WantedBy=multi-user.target




More information about the systemd-devel mailing list