Difference between revisions of "Systemd for voipmonitor service management"

From VoIPmonitor.org
Jump to navigation Jump to search
Line 18: Line 18:
 
  #Place temp files in a secure directory, not /tmp?
 
  #Place temp files in a secure directory, not /tmp?
 
  PrivateTmp=false
 
  PrivateTmp=false
 +
KillMode=process
 
  [Install]
 
  [Install]
 
  WantedBy=multi-user.target
 
  WantedBy=multi-user.target
  
 
NOTICE: line 'After=mysql.service' gives a sense only if your mysql is installed locally.
 
NOTICE: line 'After=mysql.service' gives a sense only if your mysql is installed locally.

Revision as of 13:37, 16 January 2024

This is valid only for system that use systemd as manager for services. (After following this you will be able to use systemctl or service commands also in your OS with systemd)

Create file /etc/systemd/system/voipmonitor.service

[Unit]
Description=VOIPmonitor tool for VOIP monitoring
After=syslog.target
After=network.target
After=mysql.service

[Service]
#Restart=always
Type=forking
ExecStart=/etc/init.d/voipmonitor start
ExecStop=/etc/init.d/voipmonitor stop
#Give a reasonable amount of time for the server to start up/shut down
TimeoutStartSec=0
TimeoutStopSec=180
#Place temp files in a secure directory, not /tmp?
PrivateTmp=false
KillMode=process
[Install]
WantedBy=multi-user.target

NOTICE: line 'After=mysql.service' gives a sense only if your mysql is installed locally.