better startup scripts
This commit is contained in:
@@ -36,11 +36,6 @@ echo ""
|
||||
echo "── PTY Sidecar (systemd service) ──"
|
||||
echo " Node: $NODE_BIN ($("$NODE_BIN" -v))"
|
||||
|
||||
if systemctl is-active --quiet "$SERVICE_NAME" 2>/dev/null; then
|
||||
skip "$SERVICE_NAME service already running"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sudo tee "$SERVICE_FILE" > /dev/null << EOF
|
||||
[Unit]
|
||||
Description=Officer PTY Sidecar
|
||||
@@ -60,10 +55,16 @@ WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now "$SERVICE_NAME"
|
||||
sudo systemctl enable "$SERVICE_NAME"
|
||||
|
||||
if systemctl is-active --quiet "$SERVICE_NAME"; then
|
||||
ok "$SERVICE_NAME service installed and running"
|
||||
if systemctl is-active --quiet "$SERVICE_NAME" 2>/dev/null; then
|
||||
sudo systemctl restart "$SERVICE_NAME"
|
||||
ok "$SERVICE_NAME service updated and restarted"
|
||||
else
|
||||
warn "$SERVICE_NAME service failed to start — check 'journalctl -u $SERVICE_NAME'"
|
||||
sudo systemctl start "$SERVICE_NAME"
|
||||
if systemctl is-active --quiet "$SERVICE_NAME"; then
|
||||
ok "$SERVICE_NAME service installed and running"
|
||||
else
|
||||
warn "$SERVICE_NAME service failed to start — check 'journalctl -u $SERVICE_NAME'"
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user