ntop / nProbe

Open source components and extensions for nProbe
http://ntop.org
GNU General Public License v2.0
1.62k stars 44 forks source link

deb package post-installation script update fails #578

Closed sciolto closed 7 months ago

sciolto commented 1 year ago

On Ubuntu 20 the deb package update fails because the post-installation script is unable to restart nprobe.service:

root@nbox:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
  sntp libbpf0 libzmq5 python2.7-minimal python2.7 ntp redis-tools
  libpython2.7-minimal libpython2.7-stdlib redis-server
Learn more about Ubuntu Pro at https://ubuntu.com/pro
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up nprobe (10.2.230531-8013) ...
Rebuilding ld cache...
Making the /var/log/nprobe directory...
(Re)Starting nprobe services...
Job for nprobe.service failed because the control process exited with error code.
See "systemctl status nprobe.service" and "journalctl -xe" for details.
dpkg: error processing package nprobe (--configure):
 installed nprobe package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 nprobe
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@nbox:~# systemctl status nprobe.service
● nprobe.service - nprobe extensible NetFlow v5/v9/IPFIX probe/collector
     Loaded: loaded (/etc/systemd/system/nprobe.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2023-06-12 10:17:03 CEST; 2min 48s ago
    Process: 5774 ExecStartPre=/bin/sh -c /bin/echo "$(/bin/date) nprobe StartPre" >> /var/log/ntop-systemd.log (code=exited, status=0/SUCCESS)
    Process: 5787 ExecStartPre=/bin/sh -c /bin/sed "/^-g.*$\|^-G.*\|^--daemon-mode.*\|^--pid-file.*/s/^/#/" /etc/nprobe/nprobe.conf > /run/nprobe.conf (code=exited, status=>
    Process: 5795 ExecStopPost=/bin/rm -rf /run/nprobe.conf (code=exited, status=0/SUCCESS)
    Process: 5797 ExecStopPost=/bin/sh -c /bin/echo "$(/bin/date) nprobe StopPost" >> /var/log/ntop-systemd.log (code=exited, status=0/SUCCESS)

Jun 12 10:17:03 nbox systemd[1]: Starting nprobe extensible NetFlow v5/v9/IPFIX probe/collector...
Jun 12 10:17:03 nbox sh[5791]: /bin/sed: can't read /etc/nprobe/nprobe.conf: No such file or directory
Jun 12 10:17:03 nbox systemd[1]: nprobe.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Jun 12 10:17:03 nbox systemd[1]: nprobe.service: Failed with result 'exit-code'.
Jun 12 10:17:03 nbox systemd[1]: Failed to start nprobe extensible NetFlow v5/v9/IPFIX probe/collec

This happens when using nprobe instances that don't use the original /etc/nprobe/nprobe.conf config file:

root@nbox:~# ps -ef | grep nprobe
nprobe      1653       1  2 10:09 ?        00:00:14 /usr/bin/nprobe /run/nprobe-mirror_fabric.conf
nprobe      1655       1  0 10:09 ?        00:00:02 /usr/bin/nprobe /run/nprobe-mirror_tra.conf
nprobe      1658       1  1 10:09 ?        00:00:09 /usr/bin/nprobe /run/nprobe-mirror_mgmt.conf
nprobe      1670       1  1 10:09 ?        00:00:13 /usr/bin/nprobe /run/nprobe-mirror_vls.conf
sciolto commented 7 months ago

@cardigliano can you please review this ? It's still a thing with the latest version. thanks

cardigliano commented 7 months ago

Fix pushed, new packages will be available soon, please confirm this is fixed

sciolto commented 7 months ago

Thanks @cardigliano we will test and report back.

sciolto commented 7 months ago

@cardigliano fixed !

Thanks