committed by
Lennart Poettering
parent
cc2f3f05a7
commit
31cd5f63ce
@@ -83,6 +83,7 @@ DirectoryNotEmpty=
|
||||
Documentation=
|
||||
DynamicUser=
|
||||
ExecReload=
|
||||
ExecCondition=
|
||||
ExecStart=
|
||||
ExecStartPost=
|
||||
ExecStartPre=
|
||||
|
||||
@@ -56,6 +56,8 @@ test_data_files = '''
|
||||
test-execute/exec-capabilityboundingset-merge.service
|
||||
test-execute/exec-capabilityboundingset-reset.service
|
||||
test-execute/exec-capabilityboundingset-simple.service
|
||||
test-execute/exec-condition-failed.service
|
||||
test-execute/exec-condition-skip.service
|
||||
test-execute/exec-cpuaffinity1.service
|
||||
test-execute/exec-cpuaffinity2.service
|
||||
test-execute/exec-cpuaffinity3.service
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Test for exec condition that fails the unit
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
||||
# exit 255 will fail the unit
|
||||
ExecCondition=/bin/sh -c 'exit 255'
|
||||
|
||||
# This should not get run
|
||||
ExecStart=/bin/sh -c 'true'
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Test for exec condition that triggers skipping
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
||||
# exit codes [1, 254] will result in skipping the rest of execution
|
||||
ExecCondition=/bin/sh -c 'exit 0'
|
||||
ExecCondition=/bin/sh -c 'exit 254'
|
||||
|
||||
# This would normally fail the unit but will not get run due to the skip above
|
||||
ExecCondition=/bin/sh -c 'exit 255'
|
||||
|
||||
# This should not get run
|
||||
ExecStart=/bin/sh -c 'true'
|
||||
Reference in New Issue
Block a user