Linux Service Creation: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with "===Raspbian|Ubuntu|Debian=== <code>/etc/systemd/system/demod.service </code> <source lang="ini"> [Unit] Description=Chorke Academia amqpd app [Service] WorkingDirectory=/opt...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
===Raspbian|Ubuntu|Debian===
===Raspbian | Ubuntu | Debian===
<code>/etc/systemd/system/demod.service </code>
<code>/etc/systemd/system/demod.service </code>
<source lang="ini">
<source lang="ini">
[Unit]
[Unit]
Description=Chorke Academia amqpd app
Description=Academia AMQPD Daemon
   
   
[Service]
[Service]
Line 20: Line 20:
WantedBy=multi-user.target
WantedBy=multi-user.target
</source>
</source>
==References==
* [https://stackoverflow.com/questions/45374910 How to pass environment variables to a service started by systemd]
* [https://taras.codes/blog/hosting-an-asp-net-core-application-on-raspberry-pi-3/ Hosting an ASP.NET Core application on Raspberry Pi 3]
* [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-unit_files Managing Services with Systemd Unit Files]
* [https://www.baeldung.com/spring-boot-app-as-a-service Spring Boot Application as a Service]
* [https://support.rackspace.com/how-to/checking-running-services-on-linux/ Check running services on Linux]

Latest revision as of 10:37, 2 October 2019

Raspbian | Ubuntu | Debian

/etc/systemd/system/demod.service

[Unit]
Description=Academia AMQPD Daemon
 
[Service]
WorkingDirectory=/opt/chorke/academia/amqpd/usr/bin
ExecStart=/opt/chorke/academia/amqpd/usr/bin/amqpd
StandardOutput=syslog
Restart=always
RestartSec=10
User=www-data
KillSignal=SIGINT
SyslogIdentifier=amqpd
Environment=ACADEMIA_HOME=/opt/chorke/academia
Environment=AMQP_HOME=/opt/chorke/academia/amqpd
 
[Install]
WantedBy=multi-user.target

References