Change to user service files
This commit is contained in:
parent
2123ee319b
commit
0207013b81
7 changed files with 32 additions and 31 deletions
|
@ -5,5 +5,5 @@ systemctl disable freehl
|
|||
find ./ -type f -name "server.cfg" -print | while read LINE
|
||||
do
|
||||
GAMEDIR=$(dirname "$LINE" | cut -d '/' -f 2)
|
||||
echo systemctl disable freehl@$GAMEDIR
|
||||
systemctl --user disable freehl@$GAMEDIR
|
||||
done
|
|
@ -1,4 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
systemctl enable freehl
|
||||
systemctl enable freehl@
|
||||
systemctl --user enable freehl
|
||||
|
||||
find ./ -type f -name "server.cfg" -print | while read LINE
|
||||
do
|
||||
GAMEDIR=$(dirname "$LINE" | cut -d '/' -f 2)
|
||||
systemctl --user enable freehl@$GAMEDIR
|
||||
done
|
|
@ -6,17 +6,9 @@ ExecReload=/bin/kill $MAINPID
|
|||
KillMode=process
|
||||
Restart=on-failure
|
||||
|
||||
; You want to adjust these for your user, this example assumes debian
|
||||
User=debian
|
||||
Environment="HOME=/home/debian"
|
||||
WorkingDirectory=/home/debian/halflife/
|
||||
ExecStart=/home/debian/halflife/fteqw-sv64 -halflife
|
||||
|
||||
PrivateTmp=true
|
||||
ProtectHome=false
|
||||
ProtectSystem=full
|
||||
PrivateDevices=false
|
||||
CapabilityBoundingSet=~CAP_SYS_ADMIN
|
||||
; You want to adjust these for your setup
|
||||
WorkingDirectory=%h/halflife/
|
||||
ExecStart=%h/halflife/fteqw-sv64 -halflife
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=default.target
|
|
@ -6,17 +6,9 @@ ExecReload=/bin/kill $MAINPID
|
|||
KillMode=process
|
||||
Restart=on-failure
|
||||
|
||||
; You want to adjust these for your user, this example assumes debian
|
||||
User=debian
|
||||
Environment="HOME=/home/debian"
|
||||
WorkingDirectory=/home/debian/halflife/
|
||||
ExecStart=/home/debian/halflife/fteqw-sv64 -halflife -game %i
|
||||
|
||||
PrivateTmp=true
|
||||
ProtectHome=false
|
||||
ProtectSystem=full
|
||||
PrivateDevices=false
|
||||
CapabilityBoundingSet=~CAP_SYS_ADMIN
|
||||
; You want to adjust these for your setup
|
||||
WorkingDirectory=%h/halflife/
|
||||
ExecStart=%h/halflife/fteqw-sv64 -halflife -game %i
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=default.target
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
SERVICE_DIR="/etc/systemd/system"
|
||||
SERVICE_DIR="/etc/systemd/user"
|
||||
|
||||
find ./ -type f -name '*.service' -print | while read LINE
|
||||
do
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
systemctl restart freehl
|
||||
systemctl --user restart freehl
|
||||
|
||||
find ./ -type f -name "server.cfg" -print | while read LINE
|
||||
do
|
||||
GAMEDIR=$(dirname "$LINE" | cut -d '/' -f 2)
|
||||
echo systemctl restart freehl@$GAMEDIR
|
||||
##systemctl restart "$FILE"
|
||||
systemctl --user restart freehl@$GAMEDIR
|
||||
done
|
13
stop-services.sh
Executable file
13
stop-services.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
systemctl --user restart freehl
|
||||
|
||||
find ./ -type f -name "server.cfg" -print | while read LINE
|
||||
do
|
||||
GAMEDIR=$(dirname "$LINE" | cut -d '/' -f 2)
|
||||
|
||||
if [ "$GAMEDIR" != "valve" ]
|
||||
then
|
||||
systemctl --user restart freehl@$GAMEDIR
|
||||
fi
|
||||
done
|
Loading…
Reference in a new issue