Skip to content

feat(conf): added scheduling exec subsection, fixed typo in ExecStartPre #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ After=network.target
WantedBy=multi-user.target

[Service]
ExecPreStart=/opt/example/agent start-1
ExecPreStart=/opt/example/agent start-2
ExecStartPre=/opt/example/agent start-1
ExecStartPre=/opt/example/agent start-2
ExecStart=/opt/example/agent start
EnvironmentFile=/opt/example/.env
Restart=always
Expand All @@ -56,7 +56,7 @@ const ini = INI.fromString(unit).toObject();
WantedBy: "multi-user.target",
},
Service: {
ExecPreStart: [
ExecStartPre: [
"/opt/example/agent start-1",
"/opt/example/agent start-2",
],
Expand All @@ -81,8 +81,8 @@ After=network.target
WantedBy=multi-user.target

[Service]
ExecPreStart=/opt/example/agent start-1
ExecPreStart=/opt/example/agent start-2
ExecStartPre=/opt/example/agent start-1
ExecStartPre=/opt/example/agent start-2
ExecStart=/opt/example/agent start
EnvironmentFile=/opt/example/.env
Restart=always
Expand Down
10 changes: 5 additions & 5 deletions packages/conf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ After=network.target
WantedBy=multi-user.target

[Service]
ExecPreStart=/opt/example/agent start-1
ExecPreStart=/opt/example/agent start-2
ExecStartPre=/opt/example/agent start-1
ExecStartPre=/opt/example/agent start-2
ExecStart=/opt/example/agent start
EnvironmentFile=/opt/example/.env
Restart=always
Expand All @@ -48,7 +48,7 @@ const ini = INI.fromString(unit).toObject();
WantedBy: "multi-user.target",
},
Service: {
ExecPreStart: [
ExecStartPre: [
"/opt/example/agent start-1",
"/opt/example/agent start-2",
],
Expand All @@ -73,8 +73,8 @@ After=network.target
WantedBy=multi-user.target

[Service]
ExecPreStart=/opt/example/agent start-1
ExecPreStart=/opt/example/agent start-2
ExecStartPre=/opt/example/agent start-1
ExecStartPre=/opt/example/agent start-2
ExecStart=/opt/example/agent start
EnvironmentFile=/opt/example/.env
Restart=always
Expand Down
12 changes: 6 additions & 6 deletions packages/conf/src/__tests__/Ini.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ After=network.target
WantedBy=multi-user.target

[Service]
ExecPreStart=/opt/example/agent start-1
ExecPreStart=/opt/example/agent start-2
ExecStartPre=/opt/example/agent start-1
ExecStartPre=/opt/example/agent start-2
ExecStart=/opt/example/agent start
EnvironmentFile=/opt/example/.env
Restart=always
Expand All @@ -43,8 +43,8 @@ Description=example
After=network.target

[Service]
ExecPreStart=/opt/example/agent start-1
ExecPreStart=/opt/example/agent start-2 \
ExecStartPre=/opt/example/agent start-1
ExecStartPre=/opt/example/agent start-2 \
--option1=value1 \
--option2=value2 \
--option3=value3
Expand All @@ -67,7 +67,7 @@ describe("INI - fromString", () => {
WantedBy: "multi-user.target",
},
Service: {
ExecPreStart: [
ExecStartPre: [
"/opt/example/agent start-1",
"/opt/example/agent start-2",
],
Expand Down Expand Up @@ -101,7 +101,7 @@ describe("INI - fromString", () => {
After: "network.target",
},
Service: {
ExecPreStart: [
ExecStartPre: [
"/opt/example/agent start-1",
"/opt/example/agent start-2 --option1=value1 --option2=value2 --option3=value3",
],
Expand Down
3 changes: 2 additions & 1 deletion packages/conf/src/__tests__/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const serviceObj = {
Restart: "always",
WorkingDirectory: "/opt/example",
KillMode: "mixed",
// PrivateTmp: true,
PrivateTmp: true,
User: "root",
},
};
Expand Down Expand Up @@ -92,6 +92,7 @@ describe("Service", () => {
.setRestart("always")
.setWorkingDirectory("/opt/example")
.setKillMode("mixed")
.setPrivateTmp(true)
.setUser("root");

service
Expand Down
Loading
Loading