Difference between revisions of "Systemd for voipmonitor service management"

From VoIPmonitor.org
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
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)
 
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)
 +
 +
'''We don't recommend to use the service command in systemd environment!! The systemd can lose track of the sensor daemon.'''
  
 
Create file /etc/systemd/system/voipmonitor.service
 
Create file /etc/systemd/system/voipmonitor.service
 
  [Unit]
 
  [Unit]
  Description=VOIPmonitor tool for VOIP monitoring
+
  Description=VoIPmonitor sniffer
 
  After=syslog.target
 
  After=syslog.target
 
  After=network.target
 
  After=network.target
Line 9: Line 11:
 
   
 
   
 
  [Service]
 
  [Service]
#Restart=always
 
 
  Type=forking
 
  Type=forking
 +
Restart=no
 +
TimeoutSec=5min
 +
IgnoreSIGPIPE=no
 +
KillMode=process
 +
GuessMainPID=no
 +
RemainAfterExit=yes
 +
SuccessExitStatus=5 6
 
  ExecStart=/etc/init.d/voipmonitor start
 
  ExecStart=/etc/init.d/voipmonitor start
 
  ExecStop=/etc/init.d/voipmonitor stop
 
  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?
 
  #Place temp files in a secure directory, not /tmp?
 
  PrivateTmp=false
 
  PrivateTmp=false
Line 22: Line 27:
  
 
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.
 +
 +
Don't forget systemd reload after change.
 +
 +
systemctl daemon-reload

Latest revision as of 10:20, 13 March 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)

We don't recommend to use the service command in systemd environment!! The systemd can lose track of the sensor daemon.

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

[Unit]
Description=VoIPmonitor sniffer
After=syslog.target
After=network.target
After=mysql.service

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/init.d/voipmonitor start
ExecStop=/etc/init.d/voipmonitor stop
#Place temp files in a secure directory, not /tmp?
PrivateTmp=false
[Install]
WantedBy=multi-user.target

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

Don't forget systemd reload after change.

systemctl daemon-reload