Skip to content

Commit 71da997

Browse files
committed
feat(conf): added scheduling exec subsection, fixed typo in ExecStartPre
1 parent 5848a0f commit 71da997

File tree

6 files changed

+1485
-18
lines changed

6 files changed

+1485
-18
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ After=network.target
3636
WantedBy=multi-user.target
3737
3838
[Service]
39-
ExecPreStart=/opt/example/agent start-1
40-
ExecPreStart=/opt/example/agent start-2
39+
ExecStartPre=/opt/example/agent start-1
40+
ExecStartPre=/opt/example/agent start-2
4141
ExecStart=/opt/example/agent start
4242
EnvironmentFile=/opt/example/.env
4343
Restart=always
@@ -56,7 +56,7 @@ const ini = INI.fromString(unit).toObject();
5656
WantedBy: "multi-user.target",
5757
},
5858
Service: {
59-
ExecPreStart: [
59+
ExecStartPre: [
6060
"/opt/example/agent start-1",
6161
"/opt/example/agent start-2",
6262
],
@@ -81,8 +81,8 @@ After=network.target
8181
WantedBy=multi-user.target
8282
8383
[Service]
84-
ExecPreStart=/opt/example/agent start-1
85-
ExecPreStart=/opt/example/agent start-2
84+
ExecStartPre=/opt/example/agent start-1
85+
ExecStartPre=/opt/example/agent start-2
8686
ExecStart=/opt/example/agent start
8787
EnvironmentFile=/opt/example/.env
8888
Restart=always

packages/conf/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ After=network.target
2828
WantedBy=multi-user.target
2929
3030
[Service]
31-
ExecPreStart=/opt/example/agent start-1
32-
ExecPreStart=/opt/example/agent start-2
31+
ExecStartPre=/opt/example/agent start-1
32+
ExecStartPre=/opt/example/agent start-2
3333
ExecStart=/opt/example/agent start
3434
EnvironmentFile=/opt/example/.env
3535
Restart=always
@@ -48,7 +48,7 @@ const ini = INI.fromString(unit).toObject();
4848
WantedBy: "multi-user.target",
4949
},
5050
Service: {
51-
ExecPreStart: [
51+
ExecStartPre: [
5252
"/opt/example/agent start-1",
5353
"/opt/example/agent start-2",
5454
],
@@ -73,8 +73,8 @@ After=network.target
7373
WantedBy=multi-user.target
7474
7575
[Service]
76-
ExecPreStart=/opt/example/agent start-1
77-
ExecPreStart=/opt/example/agent start-2
76+
ExecStartPre=/opt/example/agent start-1
77+
ExecStartPre=/opt/example/agent start-2
7878
ExecStart=/opt/example/agent start
7979
EnvironmentFile=/opt/example/.env
8080
Restart=always

packages/conf/src/__tests__/Ini.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ After=network.target
2828
WantedBy=multi-user.target
2929
3030
[Service]
31-
ExecPreStart=/opt/example/agent start-1
32-
ExecPreStart=/opt/example/agent start-2
31+
ExecStartPre=/opt/example/agent start-1
32+
ExecStartPre=/opt/example/agent start-2
3333
ExecStart=/opt/example/agent start
3434
EnvironmentFile=/opt/example/.env
3535
Restart=always
@@ -43,8 +43,8 @@ Description=example
4343
After=network.target
4444
4545
[Service]
46-
ExecPreStart=/opt/example/agent start-1
47-
ExecPreStart=/opt/example/agent start-2 \
46+
ExecStartPre=/opt/example/agent start-1
47+
ExecStartPre=/opt/example/agent start-2 \
4848
--option1=value1 \
4949
--option2=value2 \
5050
--option3=value3
@@ -67,7 +67,7 @@ describe("INI - fromString", () => {
6767
WantedBy: "multi-user.target",
6868
},
6969
Service: {
70-
ExecPreStart: [
70+
ExecStartPre: [
7171
"/opt/example/agent start-1",
7272
"/opt/example/agent start-2",
7373
],
@@ -101,7 +101,7 @@ describe("INI - fromString", () => {
101101
After: "network.target",
102102
},
103103
Service: {
104-
ExecPreStart: [
104+
ExecStartPre: [
105105
"/opt/example/agent start-1",
106106
"/opt/example/agent start-2 --option1=value1 --option2=value2 --option3=value3",
107107
],

packages/conf/src/__tests__/service.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const serviceObj = {
2020
Restart: "always",
2121
WorkingDirectory: "/opt/example",
2222
KillMode: "mixed",
23-
// PrivateTmp: true,
23+
PrivateTmp: true,
2424
User: "root",
2525
},
2626
};
@@ -92,6 +92,7 @@ describe("Service", () => {
9292
.setRestart("always")
9393
.setWorkingDirectory("/opt/example")
9494
.setKillMode("mixed")
95+
.setPrivateTmp(true)
9596
.setUser("root");
9697

9798
service

0 commit comments

Comments
 (0)