2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
7 systemd-analyze set-log-level debug
8 systemd-analyze set-log-target console
10 # Create a binary for which execve() will fail
11 touch /tmp
/brokenbinary
12 chmod +x
/tmp
/brokenbinary
14 # These three commands should succeed.
15 systemd-run
--unit=one
-p Type
=simple
/bin
/sleep infinity
16 systemd-run
--unit=two
-p Type
=simple
-p User
=idontexist
/bin
/sleep infinity
17 systemd-run
--unit=three
-p Type
=simple
/tmp
/brokenbinary
19 # And now, do the same with Type=exec, where the latter two should fail
20 systemd-run
--unit=four
-p Type
=exec /bin
/sleep infinity
21 ! systemd-run
--unit=five
-p Type
=exec -p User
=idontexist
/bin
/sleep infinity
22 ! systemd-run
--unit=six
-p Type
=exec /tmp
/brokenbinary
24 systemd-analyze set-log-level info