update systemd script

This commit is contained in:
2026-01-13 13:20:32 +00:00
parent 156af3d64c
commit 363d5dbdef

View File

@@ -358,13 +358,17 @@ Description=PocketBase instance %%i
After=network.target After=network.target
[Service] [Service]
Type = simple
User = root User = root
Group = root Group = root
LimitNOFILE = 4096
Restart = always
RestartSec = 5s
StandardOutput = append:%s/%%i.log
StandardError = append:%s/%%i.log
WorkingDirectory = %s WorkingDirectory = %s
EnvironmentFile = %s EnvironmentFile = %s
ExecStart = %s/pocketbase serve --http="127.0.0.1:${PORT}" ExecStart = %s/pocketbase serve --http="127.0.0.1:${PORT}"
Restart=on-failure
LimitNOFILE=65535
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
@@ -372,7 +376,7 @@ EOF
systemctl daemon-reload systemctl daemon-reload
systemctl enable --now pb@%s systemctl enable --now pb@%s
systemctl restart pb@%s systemctl restart pb@%s
`, serviceDir, envFile, serviceDir, serviceName, serviceName) `, serviceDir, serviceDir, serviceDir, envFile, serviceDir, serviceName, serviceName)
} }
func runSSHCommand(server, script string) error { func runSSHCommand(server, script string) error {