Skip to content

Commit 3575a10

Browse files
authored
Add systemd service and socket unit files (#70)
1 parent 532fa48 commit 3575a10

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

deploy/kanae.service

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[Unit]
2+
Description=kanae
3+
Requires=kanae.socket
4+
After=network.target
5+
6+
[Service]
7+
Type=notify
8+
NotifyAccess=main
9+
User=kanae
10+
Group=kanae
11+
DynamicUser=true
12+
WorkingDirectory=/home/noelle/apps/kanae
13+
ExecStart=/home/noelle/apps/kanae/deploy/launcher.sh
14+
ExecReload=/bin/kill -s HUP $MAINPID
15+
KillMode=mixed
16+
TimeoutStopSec=5
17+
PrivateTmp=true
18+
ProtectSystem=strict
19+
20+
[Install]
21+
WantedBy=multi-user.target

deploy/kanae.socket

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[Unit]
2+
Description=kanae socket
3+
4+
[Socket]
5+
ListenStream=/run/kanae.sock
6+
# Our service won't need permissions for the socket, since it
7+
# inherits the file descriptor by socket activation.
8+
# Only the nginx daemon will need access to the socket:
9+
SocketUser=haproxy
10+
SocketGroup=haproxy
11+
# Once the user/group is correct, restrict the permissions:
12+
SocketMode=0660
13+
14+
[Install]
15+
WantedBy=sockets.target

0 commit comments

Comments
 (0)