Created
November 22, 2019 18:15
-
-
Save daharon/c088b3ede0d72fd20ac400b3060cca2d to your computer and use it in GitHub Desktop.
Calling systemd's StartTransientUnit via DBus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Trying to use the following command and recieving: | |
# Error: GDBus.Error:System.Error.ENXIO: No such device or address | |
# StartTransientUnit(in s arg_0, | |
# in s arg_1, | |
# in a(sv) arg_2, | |
# in a(sa(sv)) arg_3, | |
# out o arg_4); | |
gdbus call \ | |
--system \ | |
--dest org.freedesktop.systemd1 \ | |
--object-path /org/freedesktop/systemd1 \ | |
--method org.freedesktop.systemd1.Manager.StartTransientUnit \ | |
daharon-test.service \ | |
replace \ | |
"[('ExecStart', <'ls -h'>)]" \ | |
'[]' |
ExecStart isn't just a string, it's a a(sasb)
. The array contains commands (there can be more than one for some unit types). In each array element, the string is the pathname to execute and the array of strings is the arguments -- the information for a call to execve. The boolean is an "ignore failure" flag. See after /* Exec container */ in systemd-run run.c.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you ever figure out why you got this error? This is the only result on this topic 😅