AlexMaslakoff.icu

Things related to software development, security, marketing, e-commerce.

Template of a systemd service for an Elixir/Phoenix application

published: 13 Mar 2019

In my Elixir/Phoenix applications I use the following template for systemd services:

[Unit]
Description=my_app123
After=syslog.target
Requires=postgresql.service

[Service]
ExecStart=/home/my_user/apps/my_app123/bin/my_app123 foreground
ExecStop=/home/my_user/apps/my_app123/bin/my_app123 stop
Restart=on-abort
WorkingDirectory=/home/my_user/apps/my_app123/bin
Environment=MIX_ENV=prod
SyslogIdentifier=my_app123
User=my_user

[Install]
WantedBy=multi-user.target

Subscribe to Newsletters

Be up to date with new material and freebies