NagiosEnterprises/ncpa

Oracle Linux 9 update/re-install getting stuck

Matty-uk opened this issue · 5 comments

Hi

NCPA 3.0.1 and 3.0.2 don't seem to want to go on to Oracle Linux 9. I've tried update to them versions and also removing and reinstalling. they both get stuck on "Running scriptlet". NCPA 3.0.0 installs fine and this is what I've now gone back to for this host. I did also try running "dnf clean all" but that did not change anything.

[root@xxx ~]# dnf install ncpa
Last metadata expiration check: 0:02:25 ago on Sat 13 Apr 2024 15:49:21 BST.
Dependencies resolved.
================================================================================================================================================================================================
 Package                                    Architecture                                 Version                                        Repository                                         Size
================================================================================================================================================================================================
Installing:
 ncpa                                       x86_64                                       3.0.2-1                                        nagios-base                                        27 M

Transaction Summary
================================================================================================================================================================================================
Install  1 Package

Total download size: 27 M
Installed size: 72 M
Is this ok [y/N]: y
Downloading Packages:
ncpa-3.0.2-1.x86_64.rpm                                                                                                                                          11 MB/s |  27 MB     00:02
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                            11 MB/s |  27 MB     00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                        1/1
  Running scriptlet: ncpa-3.0.2-1.x86_64

When this is running, can you see what processes are running including children of the specified scriptlet above and post here?

Hi

I've ran "ps -auxf" and could see the command I have in a .sh script for backup preposes in my /etc/init.d/ folder. This backup takes a far while to run. So updating ncpa triggered my backup script in the /etc/init.d folder.

I've done some testing:

  1. Removed by backup script and it updated fine
  2. Created a simple test script in the /etc/init.d folder that writes out a line to a file. Downgraded ncpa and upgraded a few time to be confident of the results. The install process for ncpa 3.0.1 and 3.0.2 run any executable scripts in the /etc/init.d folder twice.

I'll be relocating my backup script, but this had better be logged as a bug.

Please provide the command tree process listing for the scriptlet. (i.e. scriptlet and all it's children).

I've already related my backup script, but it's easy to replicated.

1
Downgraded to ncpa 3.0.1 via dnf

2
Test script @ /etc/init.d/file_1234.sh with execute rights

#!/bin/bash		
echo foo foo foo >> /etc/init.d/file.txt
sleep 120

3
Trigger the update. I believe this is what you asked for, with it running the test script waiting for the sleep command to finish for the first time:

matt_lo+   58241  0.0  0.1  20416 11624 ?        Ss   09:11   0:00 /usr/lib/systemd/systemd --user
matt_lo+   58242  0.0  0.0 172300  5044 ?        S    09:11   0:00  \_ (sd-pam)
matt_lo+   58283  0.0  0.0 223552  2652 ?        Ss   09:11   0:00 SCREEN -D -R
matt_lo+   58284  0.0  0.0 224140  5488 pts/1    Ss   09:11   0:00  \_ /bin/bash
root       58310  0.0  0.0 238344  8716 pts/1    S    09:12   0:00      \_ sudo -i
root       58311  0.0  0.0 224116  5428 pts/1    S    09:12   0:00          \_ -bash
root       58510  0.0  1.1 350384 113776 pts/1   T    09:31   0:00              \_ /usr/bin/python3.9 /bin/yum --disablerepo=* --enablerepo=nagios-base update
root       60891  1.4  1.4 452180 142772 pts/1   S+   15:14   0:01              \_ /usr/bin/python3.9 /bin/yum --disablerepo=* --enablerepo=nagios-base update
root       60928  0.0  0.0 222520  3440 pts/1    S+   15:15   0:00                  \_ /bin/sh /var/tmp/rpm-tmp.oyDLKz 2
root       60939  0.0  0.0 222628  3368 pts/1    S+   15:15   0:00                      \_ /usr/bin/bash /sbin/service --status-all
root       60943  0.0  0.0   4188  3112 pts/1    S+   15:15   0:00                      |   \_ /bin/bash /etc/init.d/file_1234.sh status
root       60944  0.0  0.0   2648  1024 pts/1    S+   15:15   0:00                      |       \_ sleep 120
root       60940  0.0  0.0 221664  2172 pts/1    S+   15:15   0:00                      \_ grep -Fq ncpa_listener

4
Below is the output file @ /etc/init.d/file.txt

foo foo foo
foo foo foo

Thanks.

If the example script you provided above is the same implementation type as your backup script, the fundamental issue is you haven't written that as a SYSV init service management script. Any command script in /etc/init.d needs to be written as such. There's further requirements if this is to properly use the legacy code management for sysv scripts within systemd.

Those inherently need to be written to take a command argument like below:

start
stop
status
restart

In this case, when "service --status-all", it's calling all the init.d scripts with the 'status' command. In your case, it's just running the overall script, instead.