3d7c062ff27d6614c7765a3a2be16fb171d1b929
[akkoma] / installation / akkoma.service
1 [Unit]
2 Description=Akkoma social network
3 After=network.target postgresql.service
4
5 [Service]
6 ExecReload=/bin/kill $MAINPID
7 Restart=on-failure
8
9 ; Uncomment this if you're on Arch Linux
10 ; Evironment="PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"
11
12 ; Name of the user that runs the Akkoma service.
13 User=akkoma
14 ; Declares that Akkoma runs in production mode.
15 Environment="MIX_ENV=prod"
16
17 ; Don't listen epmd on 0.0.0.0
18 Environment="ERL_EPMD_ADDRESS=127.0.0.1"
19
20 ; Make sure that all paths fit your installation.
21 ; Path to the home directory of the user running the Akkoma service.
22 Environment="HOME=/var/lib/akkoma"
23 ; Path to the folder containing the Akkoma installation.
24 WorkingDirectory=/opt/akkoma
25 ; Path to the Mix binary.
26 ExecStart=/usr/bin/mix phx.server
27
28 ; Some security directives.
29 ; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops.
30 PrivateTmp=true
31 ; The /home, /root, and /run/user folders can not be accessed by this service anymore. If your Akkoma user has its home folder in one of the restricted places, or use one of these folders as its working directory, you have to set this to false.
32 ProtectHome=true
33 ; Mount /usr, /boot, and /etc as read-only for processes invoked by this service.
34 ProtectSystem=full
35 ; Sets up a new /dev mount for the process and only adds API pseudo devices like /dev/null, /dev/zero or /dev/random but not physical devices. Disabled by default because it may not work on devices like the Raspberry Pi.
36 PrivateDevices=false
37 ; Drops the sysadmin capability from the daemon.
38 CapabilityBoundingSet=~CAP_SYS_ADMIN
39
40 [Install]
41 WantedBy=multi-user.target