I’ve shifted my NethServer vm to a new host and have been going over the machine to make sure it’s OK.
I’ve noticed that ntopng has started itself, despite being disabled.
[root@nethserver /]# systemctl status ntopng
● ntopng.service - ntopng high-speed web-based traffic monitoring and analysis tool
Loaded: loaded (/etc/systemd/system/ntopng.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2020-06-01 03:06:01 BST; 16h ago
Main PID: 31896 (ntopng)
CGroup: /system.slice/ntopng.service
└─31896 /usr/local/bin/ntopng /run/ntopng.conf
The start time matches up with the /etc/cron.weekly/ntopng-cleanup job.
Jun 1 03:06:01 nethserver anacron[25438]: Job `cron.weekly' started
Jun 1 03:06:01 nethserver run-parts(/etc/cron.weekly)[31883]: starting ntopng-cleanup
Jun 1 03:06:01 nethserver run-parts(/etc/cron.weekly)[31902]: finished ntopng-cleanup
Jun 1 03:06:01 nethserver anacron[25438]: Job `cron.weekly' terminated
The contents of the ntopng-cleanup job is
#!/bin/bash
# top_talkers.db grows too much, just clean it once in a while
/usr/bin/find /var/tmp/ntopng/ -name top_talkers.db -delete
/usr/bin/systemctl restart ntopng
so that shouldn’t have started the ntopng service.
I’m pretty sure it wasnt running before june 1st, so why has it started now?
The service status says disabled, so why is the service showing as running?
Could this be a bug in
nethserver-ntopng-2.2.2-1.ns7.noarch
The cron job issues /usr/bin/systemctl restart ntopng
This will start ntopng even if it’s not running, or disabled.
I think the cron job should say /usr/bin/systemctl try-restart ntopng
this is what man systemctl says restart - Restart one or more units specified on the command line. If the units are not running yet, they will be started. try-restart - Restart one or more units specified on the command line if the units are running. This does nothing if units are not running. Note that, for compatibility with Red Hat init scripts, condrestart is equivalent to this command.
Edit,
Just did some testing, [root@nethserver /]# systemctl stop ntopng
stops the running ntopng service (which is also disabled)
[root@nethserver /]# systemctl status ntopng
● ntopng.service - ntopng high-speed web-based traffic monitoring and analysis tool
Loaded: loaded (/etc/systemd/system/ntopng.service; disabled; vendor preset: disabled)
Active: inactive (dead)
systemctl restart ntopng
reloads the disabled service
systemctl try-restart ntopng
does not reload the stopped and disabled service.
I think this is a bug in /etc/cron.weekly/ntopng-cleanup
I’ve changed the title and moved this post the bug section.
Thank you for reporting @bobtskutter.
For sure is a regression and you’ve already found the solution.
We are working on a new release of ntopng which should not require that cron job, so I will not going to fix the issue on the current package.
As a workaround, just remove ntopng: yum remove nethserver-ntopng ntopng