Connection refused to Sentinel

After install and setup OpenNMS 24.1.3-1 and Minion I’m stuck with Sentinel, deb opennms-sentinel is installed but there’s no connection to the service through SSH:

diecinueve:/usr/share/sentinel# ssh -p 8301 admin@localhost
ssh: connect to host localhost port 8301: Connection refused

The Sentinel service status doesn’t shed any light on the issue:

diecinueve:/usr/share/sentinel/etc# systemctl status sentinel
● sentinel.service - LSB: OpenNMS Sentinel
   Loaded: loaded (/etc/init.d/sentinel; generated)
   Active: active (running) since Sat 2019-08-24 14:07:20 -04; 28s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 17828 ExecStart=/etc/init.d/sentinel start (code=exited, status=0/SUCCESS)
    Tasks: 44 (limit: 4915)
   Memory: 229.7M
   CGroup: /system.slice/sentinel.service
           ├─18186 /bin/sh /usr/share/sentinel/bin/karaf server
           └─18240 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Xms128M -Xmx512M -XX:+UnlockDiagnosticVMOptions -Dcom.sun.management.jmxremote -XX:+HeapDumpOnOutOfMemoryErro

Aug 24 14:07:19 diecinueve systemd[1]: Starting LSB: OpenNMS Sentinel...
Aug 24 14:07:20 diecinueve runuser[18170]: pam_unix(runuser:session): session opened for user sentinel by (uid=0)
Aug 24 14:07:20 diecinueve runuser[18170]: pam_unix(runuser:session): session closed for user sentinel
Aug 24 14:07:20 diecinueve runuser[18172]: pam_unix(runuser:session): session opened for user sentinel by (uid=0)
Aug 24 14:07:20 diecinueve runuser[18172]: pam_unix(runuser:session): session closed for user sentinel
Aug 24 14:07:20 diecinueve systemd[1]: Started LSB: OpenNMS Sentinel.

But the Linux syslog has interesting info about the case:

diecinueve:/usr/share/sentinel# cat /var/log/syslog | grep sentinel
Aug 24 14:05:19 diecinueve systemd[1]: sentinel.service: Control process exited, code=exited, status=1/FAILURE
Aug 24 14:05:19 diecinueve systemd[1]: sentinel.service: Failed with result 'exit-code'.
Aug 24 14:05:19 diecinueve systemd[1]: sentinel.service: Found left-over process 13199 (karaf) in control group while starting unit. Ignoring.
Aug 24 14:05:19 diecinueve systemd[1]: sentinel.service: Found left-over process 13253 (java) in control group while starting unit. Ignoring.
Aug 24 14:06:08 diecinueve sentinel[16518]: Stopping Sentinel: Can't connect to the container. The container is not running.
Aug 24 14:06:15 diecinueve sentinel[16518]: Can't connect to the container. The container is not running.
Aug 24 14:06:21 diecinueve sentinel[16518]: Can't connect to the container. The container is not running.
Aug 24 14:06:28 diecinueve sentinel[16518]: Can't connect to the container. The container is not running.
Aug 24 14:06:34 diecinueve sentinel[16518]: Can't connect to the container. The container is not running.
Aug 24 14:06:40 diecinueve sentinel[16518]: Can't connect to the container. The container is not running.
Aug 24 14:06:47 diecinueve sentinel[16518]: Can't connect to the container. The container is not running.
Aug 24 14:06:53 diecinueve sentinel[16518]: Can't connect to the container. The container is not running.
Aug 24 14:07:00 diecinueve sentinel[16518]: Can't connect to the container. The container is not running.
Aug 24 14:07:05 diecinueve sentinel[16518]: FAILED
Aug 24 14:07:05 diecinueve sentinel[16518]: Killing Sentinel: FAILED
Aug 24 14:07:05 diecinueve sentinel[16518]: Force-killing Sentinel: OK
Aug 24 14:07:05 diecinueve systemd[1]: sentinel.service: Succeeded.
diecinueve:/usr/share/sentinel# 

I don’t know where else to look for clues to solve this issue.

I tried to reproduce your error and did a plain install on Ubuntu 18.04.3 LTS. I’ve installed with the following commands:



echo 'deb https://debian.opennms.org stable main \
      deb-src https://debian.opennms.org branches/features-sentinel main' > /etc/apt/sources.list.d/opennms.list
wget -O - https://debian.opennms.org/OPENNMS-GPG-KEY | apt-key add -
apt update
apt -y install opennms-sentinel
systemctl enable sentinel
systemctl start sentinel

The sentinel service starts up, systemctl status sentinel is active(running). The SSH port for the Karaf shell is not coming up, I’ve checked with ss -lnpt

root@vagrant:/usr/share/sentinel# ss -lnpt
State          Recv-Q          Send-Q                         Local Address:Port                    Peer Address:Port
LISTEN         0               128                                  0.0.0.0:111                          0.0.0.0:*             users:(("rpcbind",pid=514,fd=8))
LISTEN         0               128                            127.0.0.53%lo:53                           0.0.0.0:*             users:(("systemd-resolve",pid=505,fd=13))
LISTEN         0               128                                  0.0.0.0:22                           0.0.0.0:*             users:(("sshd",pid=1006,fd=3))
LISTEN         0               128                                     [::]:111                             [::]:*             users:(("rpcbind",pid=514,fd=11))
LISTEN         0               50                                         *:41427                              *:*             users:(("java",pid=16551,fd=25))
LISTEN         0               128                                     [::]:22                              [::]:*             users:(("sshd",pid=1006,fd=4))
LISTEN         0               1                         [::ffff:127.0.0.1]:38087                              *:*             users:(("java",pid=16551,fd=52))

All I have in the karaf.log is:

Sep 12, 2019 8:00:33 AM org.apache.karaf.main.Main launch
INFO: Installing and starting initial bundles
Sep 12, 2019 8:00:33 AM org.apache.karaf.main.Main launch
INFO: All initial bundles installed and set to start
Sep 12, 2019 8:00:33 AM org.apache.karaf.main.lock.SimpleFileLock lock
INFO: Trying to lock /usr/share/sentinel/lock
Sep 12, 2019 8:00:33 AM org.apache.karaf.main.lock.SimpleFileLock lock
INFO: Lock acquired
Sep 12, 2019 8:00:33 AM org.apache.karaf.main.Main$KarafLockCallback lockAcquired
INFO: Lock acquired. Setting startlevel to 100

I’ve double checked on CentOS 7 and worked as expected. It seems to me we have to open a bug report for the Sentinel packages for Debian/Ubuntu in our issue tracker.

Can you try to start the Sentinel with /usr/share/sentinel/bin/start instead of the SysV init script used by systemd?