Add systemd user service
This commit is contained in:
15
bardak.service
Normal file
15
bardak.service
Normal file
@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Bardak inventory webapp
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
#User=
|
||||
#Group=
|
||||
WorkingDirectory=/home/maybetree/srv/klankschool-bardak
|
||||
ExecStart=./run.sh
|
||||
Restart=on-failure
|
||||
StandardOutput=file:%h/log_file
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
||||
2
build.sh
2
build.sh
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
git submodule init
|
||||
git submodule update --recursive
|
||||
|
||||
|
||||
3
enable-user-service.sh
Normal file
3
enable-user-service.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
systemctl --user enable bardak.service
|
||||
12
run.sh
12
run.sh
@ -1,8 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p ./data/things
|
||||
mkdir -p ./data/trash
|
||||
|
||||
if [ -z "$(podman images -q gateau-cuda11)" ]
|
||||
then
|
||||
echo "Container missing, building..."
|
||||
./build.sh
|
||||
fi
|
||||
|
||||
podman run \
|
||||
--name bardak \
|
||||
--init \
|
||||
@ -10,8 +18,8 @@ podman run \
|
||||
-v ./data/things:/app/things \
|
||||
-v ./data/trash:/app/trash \
|
||||
--publish 8085:8085 \
|
||||
--detach \
|
||||
--restart=always \
|
||||
`#--detach` \
|
||||
`#--restart=always` \
|
||||
--replace \
|
||||
bardak
|
||||
|
||||
|
||||
Reference in New Issue
Block a user