Skip to content

Commit 65a1177

Browse files
authored
Fix cml.service not waiting for process shutdown (#160)
1 parent 9fdaf56 commit 65a1177

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

iterative/resource_runner.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,14 @@ sudo chmod +x /usr/bin/cml.sh
327327
328328
sudo bash -c 'cat << EOF > /etc/systemd/system/cml.service
329329
[Unit]
330-
Description=cml service
330+
After=default.target
331331
332332
[Service]
333-
Type=oneshot
334-
RemainAfterExit=yes
333+
Type=simple
335334
ExecStart=/usr/bin/cml.sh
336335
337336
[Install]
338-
WantedBy=multi-user.target
337+
WantedBy=default.target
339338
EOF'
340339
341340
{{if .cloud}}

iterative/testdata/script_template_cloud_aws.golden

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,14 @@ sudo chmod +x /usr/bin/cml.sh
6666

6767
sudo bash -c 'cat << EOF > /etc/systemd/system/cml.service
6868
[Unit]
69-
Description=cml service
69+
After=default.target
7070
7171
[Service]
72-
Type=oneshot
73-
RemainAfterExit=yes
72+
Type=simple
7473
ExecStart=/usr/bin/cml.sh
7574
7675
[Install]
77-
WantedBy=multi-user.target
76+
WantedBy=default.target
7877
EOF'
7978

8079

iterative/testdata/script_template_cloud_azure.golden

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,14 @@ sudo chmod +x /usr/bin/cml.sh
6767

6868
sudo bash -c 'cat << EOF > /etc/systemd/system/cml.service
6969
[Unit]
70-
Description=cml service
70+
After=default.target
7171
7272
[Service]
73-
Type=oneshot
74-
RemainAfterExit=yes
73+
Type=simple
7574
ExecStart=/usr/bin/cml.sh
7675
7776
[Install]
78-
WantedBy=multi-user.target
77+
WantedBy=default.target
7978
EOF'
8079

8180

iterative/testdata/script_template_cloud_invalid.golden

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,14 @@ sudo chmod +x /usr/bin/cml.sh
6262

6363
sudo bash -c 'cat << EOF > /etc/systemd/system/cml.service
6464
[Unit]
65-
Description=cml service
65+
After=default.target
6666
6767
[Service]
68-
Type=oneshot
69-
RemainAfterExit=yes
68+
Type=simple
7069
ExecStart=/usr/bin/cml.sh
7170
7271
[Install]
73-
WantedBy=multi-user.target
72+
WantedBy=default.target
7473
EOF'
7574

7675

0 commit comments

Comments
 (0)