Systemd for voipmonitor service management: Difference between revisions

From VoIPmonitor.org
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by 2 users 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)
== systemd ==
This is valid only for system that use systemd as manager for services.


===beware of use the service command===
'''We don't recommend to use the service command in systemd environment for manage the sniffer service state!!
The systemd can lose track of the sensor daemon.'''
==systemd's service file for voipmonitor==
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 15:
   
   
  [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 21: Line 30:
  WantedBy=multi-user.target
  WantedBy=multi-user.target


===service file and db host===
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.
===service file and napatech drivers===
Add into service file follwing lines to make sure napatech drivers are initialized before start of the sniffer service.
After=ntservice.service
Requires=ntservice.service
==reload systemd==
Don't forget systemd reload after change.
systemctl daemon-reload

Latest revision as of 15:46, 15 January 2025

systemd

This is valid only for system that use systemd as manager for services.

beware of use the service command

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

systemd's service file for voipmonitor

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

service file and db host

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

service file and napatech drivers

Add into service file follwing lines to make sure napatech drivers are initialized before start of the sniffer service.

After=ntservice.service
Requires=ntservice.service

reload systemd

Don't forget systemd reload after change.

systemctl daemon-reload