[systemd-devel] systemd-run fails with certain properties
Lennart Poettering
lennart at poettering.net
Tue Feb 10 03:12:00 PST 2015
On Fri, 06.02.15 18:09, Daurnimator (quae at daurnimator.com) wrote:
> Trying to use systemd-run with certain properties consistently fails, e.g.:
>
> $ systemd-run --scope --nice 18 --property=NoNewPrivileges=true echo test
> Unknown assignment NoNewPrivileges=true.
> Failed to create bus message: No such device or address
>
> $ systemd-run --scope --user --nice 18 -p User=nobody echo hi
> Failed to create bus message: Read-only file system
Two things:
a) not all properties are currently settable for transient units,
simply because we haven't hooked that up yet. We are happy to hook
up more though, it's just a matter of doing the work...
b) Neither NoNewPrivileges= nor User= apply to *scope* units
anyway. Note that for scope unit its not systemd that forks of the
executables, but it's your client side tool, you just ask systemd
for to manage them for you. Now, since NoNewPrivileges= and User=
are execution parameters, they don't apply at all to scope units...
systemd-run supports both running binaries as a service and as a
scope. You selected scope, hence the line you specify makes little
sense.
The reason you get two different error codes is that in the first case
we have no hook-up for NoNewPrivileges= at all so far, i.e. issue a)
hits. In the second case issue b) hits as the property is parsed but
not available for scope units.
Of course, the error messgae should be more explanatory, it's rubbish
the way it is. Added to the TODO list to fix this.
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list