use root systemd

This commit is contained in:
SimonFJ20 2025-03-07 11:35:33 +01:00
parent 7a34578981
commit d9dc6e67b7
3 changed files with 8 additions and 11 deletions

View File

@ -3,8 +3,7 @@ Description=H4 Backend
[Service]
Type=simple
#User=
#Group=
User=host
ExecStart=/home/host/h4-projekt-gruppe-0-sm/backend/build/server
Restart=on-failure
RestartSec=10

View File

@ -4,11 +4,9 @@ SERVICE=h4backend.service
set -xe
sudo cp deploy/$SERVICE /etc/systemd/user/$SERVICE
systemctl --user daemon-reload
systemctl --user enable $SERVICE
systemctl --user start $SERVICE
sudo cp deploy/$SERVICE /etc/systemd/$SERVICE
systemctl daemon-reload
systemctl enable $SERVICE
systemctl start $SERVICE

View File

@ -4,10 +4,10 @@ SERVICE=h4backend.service
set -xe
systemctl --user stop $SERVICE
systemctl --user disable $SERVICE
systemctl stop $SERVICE
systemctl disable $SERVICE
sudo rm /etc/systemd/user/$SERVICE
sudo rm /etc/systemd/$SERVICE