When I am issuing the following command systemd-run /bin/sh -c 'sleep 5' it doesn't work as expected, instead it gives the following: Aug 09 23:18:00 vmg systemd[1]: Starting /bin/sh -c sleep 5... Aug 09 23:18:00 vmg systemd[1]: Started /bin/sh -c sleep 5. Aug 09 23:18:00 vmg sh[537]: sleep: missing operand Aug 09 23:18:00 vmg sh[537]: Try 'sleep --help' for more information. Aug 09 23:18:00 vmg systemd[1]: run-536.service: main process exited, code=exited, status=1/FAILURE Aug 09 23:18:00 vmg systemd[1]: Unit run-536.service entered failed state. It seems that systemd-run splits the 'sleep 5' and executes /bin/sh -c sleep 5 instead of /bin/sh -c 'sleep 5' Is this the expected behavior?
Workaround for now: # systemd-run /bin/sh -c \'sleep 5\' or # systemd-run /bin/sh -c "'sleep 5'"
Problem is here: http://cgit.freedesktop.org/systemd/systemd/tree/src/core/dbus-service.c#n285
Fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=a6fde353.
You remove the empty "ExecStart=", which basically clears all previous ExecStart! - fputs("ExecStart=", f); Please add it back.
(In reply to comment #4) > You remove the empty "ExecStart=", which basically clears all previous > ExecStart! > > - fputs("ExecStart=", f); > > Please add it back. Hm, I admit that I'm not sure what the empty ExecStart line is for, don't we create the unit from scratch and can't we put anything we want in the ExecStart line right from the beginning? Nevertheless, I didn't touch it. If I do: sudo systemd-run /bin/sleep " 100000" I have: ==> /run/systemd/system/run-3233.service.d/90-ExecStart.conf <== [Service] ExecStart= ExecStart=@/bin/sleep "/bin/sleep" " 100000" and before my changes: ==> /run/systemd/system/run-4335.service.d/90-ExecStart.conf <== [Service] ExecStart= ExecStart=@/bin/sleep /bin/sleep 100000 Seems to be the same, module the bug, or am I missing something?
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.