Systemd for voipmonitor service management: Difference between revisions
Jump to navigation
Jump to search
(Created page with "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 system...") |
No edit summary |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
This is valid only for system that use systemd as manager for services. | == 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= | Description=VoIPmonitor sniffer | ||
After=syslog.target | After=syslog.target | ||
After=network.target | After=network.target | ||
After=mysql.service | After=mysql.service | ||
[Service] | [Service] | ||
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 | ||
#Place temp files in a secure directory, not /tmp? | #Place temp files in a secure directory, not /tmp? | ||
PrivateTmp=false | PrivateTmp=false | ||
Line 19: | Line 30: | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
NOTICE: line After=mysql.service gives sense only if your mysql is installed locally. | ===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 |
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