Template
1
0

Using systemd entirely for running a service

This commit is contained in:
Azer Abdullaev 2021-02-03 19:08:09 +01:00
parent f98f67178a
commit bae1742536
2 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,4 @@
all: build deploy
all: build deploy update
build: Makefile
podman build -t dummy:latest .
@ -7,7 +7,6 @@ deploy:
install -D -m 644 config/systemd/dummy.service /etc/systemd/system
systemctl daemon-reload
systemctl stop dummy.service
podman run --name dummy -d dummy:latest
systemctl enable dummy.service
update:

View File

@ -3,7 +3,7 @@ Description=A dummy service
[Service]
Restart=always
ExecStart=/usr/bin/podman start -a dummy
ExecStart=/usr/bin/podman run --name dummy dummy:latest
ExecStop=/usr/bin/podman stop -t 2 dummy
ExecStop=/usr/bin/podman rm -f dummy
ExecStopPost=/bin/sleep 2