service ntop start causes FATAL ERROR on CentOS

Default RPM install (from rpmforge)
CentOS 5.3
ntop 3.3.8-2.el5.rf

Works runs fine when executed from the command line, however, the following happens when service ntop start is ran.

Starting ntop:    Processing file /etc/ntop.conf for parameters...
Mon Aug  3 19:49:38 2009  NOTE: Interface merge enabled by default
Mon Aug  3 19:49:38 2009  Initializing gdbm databases
FATAL ERROR: Unrecognized/unprocessed ntop options...
                                           ,     --user=ntop, ,   --db-file-path=/var/ntop, ,     ,     ,       --use-syslog=local3, ,     ,       ,     ,         ,     ,     --daemon,

run ntop --help for usage information

    Common problems:
        -B "filter expressions" (quotes are required)
        --use-syslog=facilty (the = is required)

                                                           [FAILED]

The fix was orignally posted here, all credit goes to them, I’m reposting it here for my own convenience.

The Fix

Edit /etc/init.d/ntop

start () {
    echo -n $"Starting $prog: "
#   daemon $prog -d -L @/etc/ntop.conf
    daemon $prog @/etc/ntop.conf -d -L

In addition to this, /etc/ntop.conf needs to be edited and any spaces in the options should be replaced with =.

### Sets the user that ntop runs as.
###  NOTE: This should not be root unless you really understand the security risks.
--user=ntop

### Sets the directory that ntop runs from.
--db-file-path=/var/ntop

aaand

[root@Neptune ~]# service ntop start
Starting ntop:    Processing file /etc/ntop.conf for parameters...
Mon Aug  3 19:51:02 2009  NOTE: Interface merge enabled by default
Mon Aug  3 19:51:02 2009  Initializing gdbm databases
                                                           [  OK  ]

whaddyaknow, magic :)


About this entry