I've now found that I should look in /var/log/syslog for clues about why ntopng 
won't autostart on boot. I found entries like this:
 ntopng[1134]:  * Starting ntopng
 ntopng: [MySQLDB.cpp:624] ERROR: Failed to connect to MySQL: Can't connect to 
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 
[localhost:root]
 ntopng: [MySQLDB.cpp:624] ERROR: Failed to connect to MySQL: Can't connect to 
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 
[localhost:root]
 ntopng: [MySQLDB.cpp:78] ERROR: Unable to connect: Can't connect to local 
MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 ntopng: [main.cpp:279] ERROR: Unable to create database schema, quitting.
 ntopng[1134]:    ...done.
 root: ntopng stop
 ntopng[1516]:  * Stopping ntopng

I assumed that meant that it couldn't start because mysql hadn't started yet, 
so I altered /etc/init.d/ntopng to add mysqld to this line:
# Required-Start:    $local_fs $remote_fs $network $syslog $pf_ring mysqld

I'm no longer getting the mysql errors in the log, but it's still not starting. 
Now I just get these entries:
root: ntopng start
 ntopng[1130]:  * Starting ntopng
 ntopng[1130]:  * Unable to start ntopng
 ntopng[1130]:    ...fail!
(There are other non ntopng entries I haven't shown among those.)

Running /etc/init.d/ntopng start after bootup works fine. What else can I try 
to diagnose this?

> -----Original Message-----
> From: [email protected] [mailto:ntop-misc-
> [email protected]] On Behalf Of Peter Shute
> Sent: Friday, 28 October 2016 12:39 PM
> To: '[email protected]' <[email protected]>
> Subject: [Ntop-misc] Trouble automating daemon startup for ntopng
> 
> I've followed the instructions in the nprobe manual to get it running as a
> daemon on system start, but I can't get ntopng to do the same thing.
> 
> I've got /etc/ntopng/ntopng.conf configured, and it works ok if I run sudo
> ntopng /etc/ntopng/ntopng.conf.
> 
> /etc/ntopng/ntop.start exists, but ntopng doesn't start on boot. What's
> wrong?
> 
> Here's the ntopng.conf file contents:
> 
> -G=/var/run/ntopng.pid
> --daemon=
> -i=tcp://192.168.0.222:2055
> -w=3050
> -F="mysql;localhost;ntopng;flows;root;admin"
> --local-
> networks="192.168.0.0/23,192.168.2.0/24,192.168.3.0/24,192.168.6.0/24,192.
> 168.7.0/24,192.168.30.0/24,192.168.60.0/24,192.168.32.0/24,192.168.62.0/24,1
> 92.168.33.0/24,192.168.63.0/24,192.168.37.0/24,192.168.67.0/24"
> 
> _______________________________________________
> Ntop-misc mailing list
> [email protected]
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
_______________________________________________
Ntop-misc mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-misc

Reply via email to