Re: Latest stable Ubuntu 16.04 ntopng deb fails on supposed missing redis server but only when started by systemctl

Emanuele Faranda <[email protected]> Tue, 26 Feb 2019 10:22:00 +0100
Newsgroups gmane.linux.ntop.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============7970964842139656828==
Content-Type: multipart/alternative;
	boundary="------------C2F0F2F08D86366F6B77890B"
Content-Language: en-US-large

This is a multi-part message in MIME format.
--------------C2F0F2F08D86366F6B77890B
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

There should be no differences in running ntopng as a service or from 
cli with config file as the redis connection is handled manually and not 
by systemd.

Please open an issue on https://github.com/ntop/ntopng .

Regards,

Emanuele

On 2/26/19 2:59 AM, Kevin Branch wrote:
> Indeed I can:
>
> root@NSM:~# redis-cli info
> # Server
> redis_version:3.0.6
> redis_git_sha1:00000000
> redis_git_dirty:0
> redis_build_id:28b6715d3583bf8e
> redis_mode:standalone
> os:Linux 4.4.0-141-generic x86_64
> arch_bits:64
> multiplexing_api:epoll
> gcc_version:5.4.0
> process_id:5184
> run_id:ee16ae2d1cf3121a11195d9dae222fe65199b26a
> tcp_port:6379
> uptime_in_seconds:458809
> uptime_in_days:5
> hz:10
> lru_clock:7642404
> config_file:/etc/redis/redis.conf
>
> # Clients
> connected_clients:3
> client_longest_output_list:0
> client_biggest_input_buf:0
> blocked_clients:0
>
> # Memory
> used_memory:7106160
> used_memory_human:6.78M
> used_memory_rss:19603456
> used_memory_peak:24644712
> used_memory_peak_human:23.50M
> used_memory_lua:36864
> mem_fragmentation_ratio:2.76
> mem_allocator:jemalloc-3.6.0
>
> # Persistence
> loading:0
> rdb_changes_since_last_save:604
> rdb_bgsave_in_progress:0
> rdb_last_save_time:1551146252
> rdb_last_bgsave_status:ok
> rdb_last_bgsave_time_sec:0
> rdb_current_bgsave_time_sec:-1
> aof_enabled:0
> aof_rewrite_in_progress:0
> aof_rewrite_scheduled:0
> aof_last_rewrite_time_sec:-1
> aof_current_rewrite_time_sec:-1
> aof_last_bgrewrite_status:ok
> aof_last_write_status:ok
>
> # Stats
> total_connections_received:17
> total_commands_processed:97662381
> instantaneous_ops_per_sec:54
> total_net_input_bytes:7594073868
> total_net_output_bytes:6696286668
> instantaneous_input_kbps:4.66
> instantaneous_output_kbps:3.12
> rejected_connections:0
> sync_full:0
> sync_partial_ok:0
> sync_partial_err:0
> expired_keys:982251
> evicted_keys:0
> keyspace_hits:21703677
> keyspace_misses:58363958
> pubsub_channels:0
> pubsub_patterns:0
> latest_fork_usec:1174
> migrate_cached_sockets:0
>
> # Replication
> role:master
> connected_slaves:0
> master_repl_offset:0
> repl_backlog_active:0
> repl_backlog_size:1048576
> repl_backlog_first_byte_offset:0
> repl_backlog_histlen:0
>
> # CPU
> used_cpu_sys:4611.45
> used_cpu_user:1096.64
> used_cpu_sys_children:17.90
> used_cpu_user_children:79.96
>
> # Cluster
> cluster_enabled:0
>
> # Keyspace
> db0:keys=9845,expires=9762,avg_ttl=1832241
>
>
> On Thu, Feb 21, 2019 at 4:04 AM Emanuele Faranda <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Hi Kevin,
>
>     Can you successfully use the redis cli tools? For example, can you
>     successfully run "redis-cli info" from the terminal?
>
>     Regards,
>
>     Emanuele
>
>     On 2/21/19 3:50 AM, Kevin Branch wrote:
>>     This issue has come up with newer version(s) of the ntopng deb. 
>>     Specifically I was just now testing with this deb:
>>
>>         http://packages.ntop.org/apt-stable/16.04/x64/ntopng_3.8.190219-6179_amd64.deb
>>
>>     and using this /etc/ntopng/ntopng.conf
>>
>>
>>         --http-port=0
>>         --https-port=3000
>>         --data-dir=/usr/local/ntopng
>>         --local-networks="192.168.0.0/16,10.0.0.0/8,172.16.0.0/12
>>         <http://192.168.0.0/16,10.0.0.0/8,172.16.0.0/12>"
>>         --interface=eth1
>>         --interface=eth2
>>         --dns-mode=1
>>         --community
>>         --daemon
>>         --disable-login=1
>>         -G=/var/tmp/ntopng.pid
>>
>>     If I try to start it with "systemctl start ntopng", it fails with
>>     this complaint even through stock Ubuntu redis-server is indeed
>>     running:
>>
>>
>>         Feb 20 19:29:35 nsm.server.org
>>         <http://nsm.server.org/> ntopng[7443]: 20/Feb/2019 19:29:35
>>         [Redis.cpp:111] ERROR: ntopng requires redis server to be up
>>         and running
>>         Feb 20 19:29:35 nsm.server .org ntopng[7443]: 20/Feb/2019
>>         19:29:35 [Redis.cpp:112] ERROR: Please start it and try again
>>         or use -r
>>         Feb 20 19:29:35 nsm.server .org ntopng[7443]: 20/Feb/2019
>>         19:29:35 [Redis.cpp:113] ERROR: to specify a redis server
>>         other than the default
>>
>>
>>     Manually adding the -r option to ntopng.conf pointed at the
>>     running redis-server listener makes no difference.
>>
>>     But if I start it ntopng the manual way, it starts up,
>>     daemonizes, and works just fine in my web browser:
>>
>>         /usr/local/bin/ntopng /etc/ntopng/ntopng.conf
>>
>>     In either case, my redis-server is installed and running just fine
>>
>>         root@nsm:~# apt info redis-server
>>         E: Invalid operation info
>>         root@nsm:~# apt show redis-server
>>         Package: redis-server
>>         Version: 2:3.0.6-1ubuntu0.3
>>         Priority: optional
>>         Section: universe/misc
>>         Source: redis
>>         Origin: Ubuntu
>>         ...
>>
>>         root@nsm:~# systemctl status redis-server
>>         ● redis-server.service - Advanced key-value store
>>            Loaded: loaded (/lib/systemd/system/redis-server.service;
>>         enabled; vendor preset: enabled)
>>            Active: active (running) since Wed 2019-02-20 18:31:08
>>         UTC; 56min ago
>>            ...
>>
>>
>>     Somehow it appears that the running redis-server process is
>>     invisible to systemd where ntopng is involved, thus preventing my
>>     from using systemctl to start it.
>>
>>     Do you have any idea what might be going on?
>>     Kevin Branch
>>
>>     _______________________________________________
>>     Ntop mailing list
>>     [email protected]  <mailto:[email protected]>
>>     http://listgateway.unipi.it/mailman/listinfo/ntop
>     _______________________________________________
>     Ntop mailing list
>     [email protected] <mailto:[email protected]>
>     http://listgateway.unipi.it/mailman/listinfo/ntop
>
>
> _______________________________________________
> Ntop mailing list
> [email protected]
> http://listgateway.unipi.it/mailman/listinfo/ntop

--------------C2F0F2F08D86366F6B77890B
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>There should be no differences in running ntopng as a service or
      from cli with config file as the redis connection is handled
      manually and not by systemd.</p>
    <p>Please open an issue on <a class="moz-txt-link-freetext" href="https://github.com/ntop/ntopng">https://github.com/ntop/ntopng</a> .</p>
    <p>Regards,</p>
    <p>Emanuele<br>
    </p>
    <div class="moz-cite-prefix">On 2/26/19 2:59 AM, Kevin Branch wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CA+dGL9F3_8-3w42xx9dDhKH2VG8f2Hpe+daAd9oLN__YdTHADg@mail.gmail.com">
      <div dir="ltr">
        <div dir="ltr">Indeed I can:
          <div><br>
          </div>
          <div>
            <div>root@NSM:~# redis-cli info</div>
            <div># Server</div>
            <div>redis_version:3.0.6</div>
            <div>redis_git_sha1:00000000</div>
            <div>redis_git_dirty:0</div>
            <div>redis_build_id:28b6715d3583bf8e</div>
            <div>redis_mode:standalone</div>
            <div>os:Linux 4.4.0-141-generic x86_64</div>
            <div>arch_bits:64</div>
            <div>multiplexing_api:epoll</div>
            <div>gcc_version:5.4.0</div>
            <div>process_id:5184</div>
            <div>run_id:ee16ae2d1cf3121a11195d9dae222fe65199b26a</div>
            <div>tcp_port:6379</div>
            <div>uptime_in_seconds:458809</div>
            <div>uptime_in_days:5</div>
            <div>hz:10</div>
            <div>lru_clock:7642404</div>
            <div>config_<a class="moz-txt-link-freetext" href="file:/etc/redis/redis.conf">file:/etc/redis/redis.conf</a></div>
            <div><br>
            </div>
            <div># Clients</div>
            <div>connected_clients:3</div>
            <div>client_longest_output_list:0</div>
            <div>client_biggest_input_buf:0</div>
            <div>blocked_clients:0</div>
            <div><br>
            </div>
            <div># Memory</div>
            <div>used_memory:7106160</div>
            <div>used_memory_human:6.78M</div>
            <div>used_memory_rss:19603456</div>
            <div>used_memory_peak:24644712</div>
            <div>used_memory_peak_human:23.50M</div>
            <div>used_memory_lua:36864</div>
            <div>mem_fragmentation_ratio:2.76</div>
            <div>mem_allocator:jemalloc-3.6.0</div>
            <div><br>
            </div>
            <div># Persistence</div>
            <div>loading:0</div>
            <div>rdb_changes_since_last_save:604</div>
            <div>rdb_bgsave_in_progress:0</div>
            <div>rdb_last_save_time:1551146252</div>
            <div>rdb_last_bgsave_status:ok</div>
            <div>rdb_last_bgsave_time_sec:0</div>
            <div>rdb_current_bgsave_time_sec:-1</div>
            <div>aof_enabled:0</div>
            <div>aof_rewrite_in_progress:0</div>
            <div>aof_rewrite_scheduled:0</div>
            <div>aof_last_rewrite_time_sec:-1</div>
            <div>aof_current_rewrite_time_sec:-1</div>
            <div>aof_last_bgrewrite_status:ok</div>
            <div>aof_last_write_status:ok</div>
            <div><br>
            </div>
            <div># Stats</div>
            <div>total_connections_received:17</div>
            <div>total_commands_processed:97662381</div>
            <div>instantaneous_ops_per_sec:54</div>
            <div>total_net_input_bytes:7594073868</div>
            <div>total_net_output_bytes:6696286668</div>
            <div>instantaneous_input_kbps:4.66</div>
            <div>instantaneous_output_kbps:3.12</div>
            <div>rejected_connections:0</div>
            <div>sync_full:0</div>
            <div>sync_partial_ok:0</div>
            <div>sync_partial_err:0</div>
            <div>expired_keys:982251</div>
            <div>evicted_keys:0</div>
            <div>keyspace_hits:21703677</div>
            <div>keyspace_misses:58363958</div>
            <div>pubsub_channels:0</div>
            <div>pubsub_patterns:0</div>
            <div>latest_fork_usec:1174</div>
            <div>migrate_cached_sockets:0</div>
            <div><br>
            </div>
            <div># Replication</div>
            <div>role:master</div>
            <div>connected_slaves:0</div>
            <div>master_repl_offset:0</div>
            <div>repl_backlog_active:0</div>
            <div>repl_backlog_size:1048576</div>
            <div>repl_backlog_first_byte_offset:0</div>
            <div>repl_backlog_histlen:0</div>
            <div><br>
            </div>
            <div># CPU</div>
            <div>used_cpu_sys:4611.45</div>
            <div>used_cpu_user:1096.64</div>
            <div>used_cpu_sys_children:17.90</div>
            <div>used_cpu_user_children:79.96</div>
            <div><br>
            </div>
            <div># Cluster</div>
            <div>cluster_enabled:0</div>
            <div><br>
            </div>
            <div># Keyspace</div>
            <div>db0:keys=9845,expires=9762,avg_ttl=1832241</div>
          </div>
          <div><br>
          </div>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Thu, Feb 21, 2019 at 4:04
          AM Emanuele Faranda &lt;<a href="mailto:[email protected]"
            moz-do-not-send="true">[email protected]</a>&gt; wrote:<br>
        </div>
        <blockquote class="gmail_quote">
          <div>
            <p>Hi Kevin,</p>
            <p>Can you successfully use the redis cli tools? For
              example, can you successfully run "redis-cli info" from
              the terminal?</p>
            <p>Regards,<br>
            </p>
            <p>Emanuele<br>
            </p>
            <div class="gmail-m_1193236798133950657moz-cite-prefix">On
              2/21/19 3:50 AM, Kevin Branch wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div>This issue has come up with newer version(s)
                        of the ntopng deb.  Specifically I was just now
                        testing with this deb:</div>
                      <div><br>
                      </div>
                      <blockquote>
                        <div><a
href="http://packages.ntop.org/apt-stable/16.04/x64/ntopng_3.8.190219-6179_amd64.deb"
                            target="_blank" moz-do-not-send="true">http://packages.ntop.org/apt-stable/16.04/x64/ntopng_3.8.190219-6179_amd64.deb</a></div>
                        <div><br>
                        </div>
                      </blockquote>
                      and using this /etc/ntopng/ntopng.conf<br>
                    </div>
                    <blockquote>
                      <div>
                        <div><br>
                        </div>
                        <div>--http-port=0</div>
                      </div>
                      <div>
                        <div>--https-port=3000</div>
                      </div>
                      <div>
                        <div>--data-dir=/usr/local/ntopng</div>
                      </div>
                      <div>
                        <div>--local-networks="<a
                            href="http://192.168.0.0/16,10.0.0.0/8,172.16.0.0/12"
                            target="_blank" moz-do-not-send="true">192.168.0.0/16,10.0.0.0/8,172.16.0.0/12</a>"</div>
                      </div>
                      <div>
                        <div>--interface=eth1</div>
                      </div>
                      <div>
                        <div>--interface=eth2</div>
                      </div>
                      <div>
                        <div>--dns-mode=1</div>
                      </div>
                      <div>
                        <div>--community</div>
                      </div>
                      <div>
                        <div>--daemon</div>
                      </div>
                      <div>
                        <div>--disable-login=1</div>
                      </div>
                      <div>
                        <div>-G=/var/tmp/ntopng.pid</div>
                      </div>
                      <div><br>
                      </div>
                    </blockquote>
                    If I try to start it with "systemctl start ntopng",
                    it fails with this complaint even through stock
                    Ubuntu redis-server is indeed running:</div>
                  <blockquote>
                    <div>
                      <div>
                        <div><br>
                        </div>
                        <div>Feb 20 19:29:35 <a
                            href="http://nsm.server.org/"
                            target="_blank" moz-do-not-send="true">nsm.server.org</a> ntopng[7443]:
                          20/Feb/2019 19:29:35 [Redis.cpp:111] ERROR:
                          ntopng requires redis server to be up and
                          running</div>
                      </div>
                    </div>
                    <div>
                      <div>
                        <div>Feb 20 19:29:35 nsm.server .org
                          ntopng[7443]: 20/Feb/2019 19:29:35
                          [Redis.cpp:112] ERROR: Please start it and try
                          again or use -r</div>
                      </div>
                    </div>
                    <div>
                      <div>
                        <div>Feb 20 19:29:35 nsm.server .org
                          ntopng[7443]: 20/Feb/2019 19:29:35
                          [Redis.cpp:113] ERROR: to specify a redis
                          server other than the default</div>
                      </div>
                    </div>
                  </blockquote>
                  <div dir="ltr">
                    <div><br>
                    </div>
                    <div>Manually adding the -r option to ntopng.conf
                      pointed at the running redis-server listener makes
                      no difference.</div>
                    <div><br>
                    </div>
                    <div>But if I start it ntopng the manual way, it
                      starts up, daemonizes, and works just fine in my
                      web browser:</div>
                    <div><br>
                    </div>
                  </div>
                  <blockquote>
                    <div dir="ltr">
                      <div>/usr/local/bin/ntopng /etc/ntopng/ntopng.conf<br>
                      </div>
                      <div><br>
                      </div>
                    </div>
                  </blockquote>
                </div>
                <div>In either case, my redis-server is installed and
                  running just fine</div>
                <div dir="ltr"><br>
                  <div dir="ltr">
                    <blockquote>
                      <div>
                        <div>root@nsm:~# apt info redis-server</div>
                        <div>E: Invalid operation info</div>
                        <div>root@nsm:~# apt show redis-server</div>
                        <div>Package: redis-server</div>
                        <div>Version: 2:3.0.6-1ubuntu0.3</div>
                        <div>Priority: optional</div>
                        <div>Section: universe/misc</div>
                        <div>Source: redis</div>
                        <div>Origin: Ubuntu</div>
                        <div>...</div>
                        <div><br>
                        </div>
                        <div>root@nsm:~# systemctl status redis-server</div>
                        <div>● redis-server.service - Advanced key-value
                          store</div>
                        <div>   Loaded: loaded
                          (/lib/systemd/system/redis-server.service;
                          enabled; vendor preset: enabled)</div>
                        <div>   Active: active (running) since Wed
                          2019-02-20 18:31:08 UTC; 56min ago</div>
                        <div>   ...</div>
                      </div>
                    </blockquote>
                    <br>
                    <div dir="ltr">Somehow it appears that the running
                      redis-server process is invisible to systemd where
                      ntopng is involved, thus preventing my from using
                      systemctl to start it.</div>
                    <div dir="ltr"><br>
                    </div>
                    <div>Do you have any idea what might be going on?  </div>
                    <div class="gmail-m_1193236798133950657gmail-yj6qo
                      gmail-m_1193236798133950657gmail-ajU">
                      <div id="gmail-m_1193236798133950657gmail-:346"
                        class="gmail-m_1193236798133950657gmail-ajR"><img
                          class="gmail-m_1193236798133950657gmail-ajT"
                          moz-do-not-send="true"></div>
                    </div>
                    <span class="gmail-m_1193236798133950657gmail-HOEnZb
                      gmail-m_1193236798133950657gmail-adL">
                      <div>Kevin Branch</div>
                    </span></div>
                </div>
              </div>
              <br>
              <fieldset
                class="gmail-m_1193236798133950657mimeAttachmentHeader"></fieldset>
              <pre class="gmail-m_1193236798133950657moz-quote-pre">_______________________________________________
Ntop mailing list
<a class="gmail-m_1193236798133950657moz-txt-link-abbreviated" href="mailto:[email protected]" target="_blank" moz-do-not-send="true">[email protected]</a>
<a class="gmail-m_1193236798133950657moz-txt-link-freetext" href="http://listgateway.unipi.it/mailman/listinfo/ntop" target="_blank" moz-do-not-send="true">http://listgateway.unipi.it/mailman/listinfo/ntop</a></pre>
            </blockquote>
          </div>
          _______________________________________________<br>
          Ntop mailing list<br>
          <a href="mailto:[email protected]" target="_blank"
            moz-do-not-send="true">[email protected]</a><br>
          <a href="http://listgateway.unipi.it/mailman/listinfo/ntop"
            rel="noreferrer" target="_blank" moz-do-not-send="true">http://listgateway.unipi.it/mailman/listinfo/ntop</a></blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Ntop mailing list
<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
<a class="moz-txt-link-freetext" href="http://listgateway.unipi.it/mailman/listinfo/ntop">http://listgateway.unipi.it/mailman/listinfo/ntop</a></pre>
    </blockquote>
  </body>
</html>

--------------C2F0F2F08D86366F6B77890B--

--===============7970964842139656828==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ntop mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop
--===============7970964842139656828==--