Issue in starting icinga2 services (source install)

Hi

We have install icinga2 in linux RHEL 7.2. When tried to start icinga2 services, a message “Another instance of Icinga already running with PID” was shown. We could see there are two sbin folders under /icinga/sbin and icinga/lib64/sbin

Please find below the actual messages

information/cli: Icinga application loader (version: r2.11.0-1)
[2019-12-06 13:42:05 +0100] critical/cli: Another instance of Icinga already running with PID looks like teh icinga daemon is running from the lib64 path.

/icinga/lib64/icinga2/sbin/icinga2 --no-stack-rlimit daemon -c

Kindly help us in resolving the issue

Thanks&Regards
Srininvas

Hi

We have install icinga2 in linux RHEL 7.2.

How (give details) did you install it?

When tried to start icinga2 services

What command are you using to do this?

a message “Another instance of Icinga already running with PID” was shown.

What happens if you kill that PID and then restart Icinga2?

We could see there are two sbin folders under /icinga/sbin

You have an “icinga” folder at the root level??

and icinga/lib64/sbin

Is that an exact quote of the name - isn’t it “icinga2”? Also, where does
that directory name exist (it doesn’t start with a /, so I’m not sure where
you’re starting from to show that path)?

I’m even more interested to know how you installed Icinga2.

Please find below the actual messages

information/cli: Icinga application loader (version: r2.11.0-1)
[2019-12-06 13:42:05 +0100] critical/cli: Another instance of Icinga
already running with PID looks like teh icinga daemon is running from the
lib64 path.

/icinga/lib64/icinga2/sbin/icinga2 --no-stack-rlimit daemon -c

Kindly help us in resolving the issue

What happens if you reboot the machine? Does any instance of Icinga get
started? If so, what is its full path?

As asked above, what happens if you kill the existing instance and then start
Icinga using whatever command you are using to try to start it?

Did the installation process appear to go cleanly, or did you run into any
problems and try again (maybe doing it slightly differently)?

Antony.

Hi

Thanks for the prompt response

How did sou install it?
A: We installed it from source code (tar.gz file)

What command are you using to do this?
A: ./icinga2 status, ./icinga2 start

What happens if you kill that PID and then restart icinga2?
A: After killing PID, and starting again, message is shown as “Done”. When we check the status (using ./icinga2 status) a message “Not running” is displayed.

You have an “icinga” folder at root level?

A: No icinga folder is not at root level. It is in custom path “/xx/yy/zz/icinga” custom path “/xx/yy/zz” is the custom path under wich “icinga” folder got created during installation

Is that an exact quote of the name - isn’t it “icinga2”? Also, where doesthat directory name exist (it doesn’t start with a /, so I’m not sure whereyou’re starting from to show that path)?

A: icinga/lib64/sbin – it is exactly /xx/yy/zz/icinga/lib64

How the icinga2 was isntalled?

A:
We compiled (with cmake) and build the source code
soucre code: icinga2-2.11.0.tar.gz
Compilation: using cmake
build :make
Install :make install

Did the installation process appear to go cleanly, or did you run into any problems and try again (maybe doing it slightly differently)?

A: Installation process was clean without any errors

What happens if you reboot the machine? Does any instance of Icinga get started? If so, what is its full path?

A: Since we have not enabled enable-bootstart, instance did not start automatically after reboot

What happens if you kill the existing instance and then start Icinga using whatever command you are using to try to start it?

A: After killing PID, and starting again, message is shown as “Done”. When we check the status
(using ./icinga2 status) a message “Not running” is displayed.

Thanks&Regard
Srinivas

Hi

Thanks for the prompt response

How did sou install it?
A: We installed it from source code (tar.gz file)

You should be aware that that is not officially supported, and makes things more
difficult for people here to provide help, since your system will not be the
same as a package-installed version, as documented at
https://icinga.com/docs/icinga2/latest/doc/02-installation/

What command are you using to do this?
A: ./icinga2 status, ./icinga2 start

Well, that’s completely different from the way you would start a package-
installed version, and I’m immediately out of my depth here, because I’ve
never tried to start Icinga2 in such a way.

What happens if you kill that PID and then restart icinga2?
A: After killing PID, and starting again, message is shown as “Done”.
When we check the status (using ./icinga2 status) a message “Not
running” is displayed.

Okay, so that makes me start to wonder “what started that first Icinga process
to begin with?” and also “was it running effectively and could be used?”

You have an “icinga” folder at root level?

A: No icinga folder is not at root level. It is in custom path
“/xx/yy/zz/icinga” custom path “/xx/yy/zz” is the custom path under wich
“icinga” folder got created during installation

Okay, understood.

Is that an exact quote of the name - isn’t it “icinga2”? Also, where
doesthat directory name exist (it doesn’t start with a /, so I’m not sure
whereyou’re starting from to show that path)?

A: icinga/lib64/sbin – it is exactly /xx/yy/zz/icinga/lib64

I’m surprised - again, package installed versions have “icinga2” in the path
name.

How the icinga2 was isntalled?

A:
We compiled (with cmake) and build the source code
soucre code: icinga2-2.11.0.tar.gz
Compilation: using cmake
build :make
Install :make install

Out of interest, why did you choose to install from sorce instead of using the
RHEL 7 package?

Did the installation process appear to go cleanly, or did you run into any
problems and try again (maybe doing it slightly differently)?

A: Installation process was clean without any errors

Okay, that’s good, at least.

What happens if you reboot the machine? Does any instance of Icinga get
started? If so, what is its full path?

A: Since we have not enabled enable-bootstart, instance did not start
automatically after reboot

Hm, so I still wonder how that original instance of Icinga got started.

What happens if you kill the existing instance and then start Icinga using
whatever command you are using to try to start it?

A: After killing PID, and starting again, message is shown as “Done”.
When we check the status (using ./icinga2 status) a message “Not
running” is displayed.

I’m going to have to hand over to someone who has done anything like this
before, as I have no experience of running the icinga2 binary directly from
the command line like this.

Regards,

Antony.

Here is the whole summary for the above queries.

we have installed icinga in the below custom path.

/xyz/abc/icinga2/icinga

Initially no icinga2 services were running.

to start the icinga services we are using below command.

/xyz/abc/icinga2/icinga/etc/init.d/./icinga2 start

After this command we see Done.

But when we check the status using below command
/xyz/abc/icinga2/icinga/etc/init.d/./icinga2 status then it is showing status as “Not running” but we could see in the icinga.log it is checking for the server checks and log is getting updated.

also when i see ps -ef | grep icinga2 I could see icinga2 services are running with Deamon under /XYZ/abc/icinga2/icinga/etc/lib64/icinga2/sbin/icinga2 …etc.

Any one can help in this regards?

We have opted the build path since we can not install icinga in the default path as per our organization policy.

with Regards,
Srinivas

Hi

We could resolve the above issue by making changes in /icinga/etc/init.d/icinga2 file.
as explained below

Go to path “/xyz/abc/hhh/icinga/etc/init.d” ("/xyz/abc/hhh" is the custom path) and edit icinga2 file

                  "/xyz/abc/hhh/icinga/etc/init.d / vi icinga2 " 

Make the following changes

We have changed the path/location " /xyz/abc/hhh/icinga/lib64/icinga2/sbin/icinga2 " in if condition as shown in the below snippet which resolved our issue

"
pid=cat $ICINGA2_PID_FILE
if /xzy/abc/hhh/icinga/lib64/icinga2/sbin/icinga2 internal signal -s SIGCHLD -p $pid >/dev/null 2>&1; then
"
Now we are able to find the current status of icinga services properly i.e, if running, not running

Thanks&Regard
Srinivas