When upgrading Sentinel from an older version, the service file doesn't point to the main installation, but rather to /etc/init.d/sentinel which doesn't exist

Description

When upgrading from Sentinel 31.0.4 to Sentinel 31.0.6, the sentinel.service file isn’t updated and tries to start the service from /etc/init.d/sentinel, but the file no longer exists there but rather at /opt/sentinel/bin/sentinel.

Doing a clean install of Sentinel 31.0.6 also does not generate an appropriate service file that points to /opt/sentinel/bin/sentinel.

My testing was done with RHEL9, but this likely affects all other RHEL based distros. Debian/Ubuntu seem to be properly configured,

Further detail from testing on RHEL9:
On a test system, I did an install of Sentinel 31.0.4 and then upgraded it to 31.0.6 and here are my findings.

The /etc/init.d/sentinel script exists:

/etc/init.d ├── /etc/init.d/README └── /etc/init.d/sentinel 0 directories, 2 files

The Sentinel service references /etc/init.d/sentinel and is being run from there:

# /usr/lib/systemd/system/sentinel.service [Unit] Description=The OpenNMS Sentinel distributed client. Requires=network.target network-online.target After=network.target network-online.target [Service] User=sentinel EnvironmentFile=-/opt/sentinel/etc/sentinel PIDFile=/opt/sentinel/data/log/sentinel.pid Type=forking ExecStart=/etc/init.d/sentinel start ExecStop=/etc/init.d/sentinel stop AmbientCapabilities=CAP_NET_RAW CAP_NET_BIND_SERVICE [Install] WantedBy=multi-user.target

There is no /opt/sentinel/bin/sentinel file:

[root@rhel9h ~]# ls -la /opt/sentinel/bin/sentinel ls: cannot access '/opt/sentinel/bin/sentinel': No such file or directory

With Sentinel 31.0.6, the /etc/init.d/sentinel file does not exist:

[root@rhel9h ~]# tree -f /etc/init.d /etc/init.d └── /etc/init.d/README 0 directories, 1 file

The Sentinel service still references /etc/init.d/sentinel, but that file doesn't exist:

[root@rhel9h ~]# systemctl cat sentinel # /usr/lib/systemd/system/sentinel.service [Unit] Description=The OpenNMS Sentinel distributed client. Requires=network.target network-online.target After=network.target network-online.target [Service] User=sentinel EnvironmentFile=-/opt/sentinel/etc/sentinel PIDFile=/opt/sentinel/data/log/sentinel.pid Type=forking ExecStart=/etc/init.d/sentinel start ExecStop=/etc/init.d/sentinel stop AmbientCapabilities=CAP_NET_RAW CAP_NET_BIND_SERVICE [Install] WantedBy=multi-user.target

The Sentinel executable does exist at /opt/sentinel/bin/sentinel:

[root@rhel9h ~]# ls -la /opt/sentinel/bin/sentinel -rwxr-xr-x. 1 sentinel sentinel 5629 Apr 11 16:51 /opt/sentinel/bin/sentinel

The user would either need to modify the service file to point to /opt/sentinel/bin/sentinel or copy/make a symbolic link of that file to be at /etc/init.d/sentinel.

The service file should ultimately be updated to point to /opt/sentinel/bin/sentinel similar to how other service file units work to more natively work with systemd.

Environment

RHEL7, RHEL8, RHEL9, RHEL Derivatives, possibly Debian/Ubuntu

Acceptance / Success Criteria

None

Activity

Show:

David Schlenk May 11, 2023 at 3:09 PM

Will Keaney April 18, 2023 at 9:04 PM

I had the same result on RHEL 7.9.

Jeff Gehlbach April 18, 2023 at 8:17 PM

I’ve prioritized this issue and https://opennms.atlassian.net/browse/NMS-15600 because it’s clear that they will impact all Minion and Sentinel users on RPM-based platforms.

Whoever picks up this issue, please also have a look at https://opennms.atlassian.net/browse/NMS-15605 in case it’s a super easy thing to knock out while you’re already in the neighborhood. It’s a much lower priority, though.

Fixed

Details

Assignee

Reporter

HB Grooming Date

HB Backlog Status

Components

Sprint

Affects versions

Priority

PagerDuty

Created April 18, 2023 at 6:38 PM
Updated June 15, 2023 at 3:48 PM
Resolved June 15, 2023 at 3:48 PM

Flag notifications