Systemd for voipmonitor service management

From VoIPmonitor.org
Revision as of 15:46, 15 January 2025 by Petr.halounek (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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