Page 1 of 1

Run a script at Core Startup

Posted: Mon Mar 25, 2019 5:55 pm
by grenley
Hi.
I have a script I want to run at Core startup.
It is a socket listener that I want started with Core and run the whole time Core is active.
Where is the best place to put the script execution?
Thanks, Rick

Re: Run a script at Core Startup

Posted: Tue Mar 26, 2019 1:46 pm
by scottwilkerson
About the best I can suggest would be to modify the init script (orsystemd service file) to load your script and kill it when nagios stops.

There is no mechanism in Core directly to start and stop scripts like this.

Re: Run a script at Core Startup

Posted: Tue Mar 26, 2019 5:34 pm
by grenley
Thanks for the reply.
That would be fine but I see no orsystemd file

Re: Run a script at Core Startup

Posted: Wed Mar 27, 2019 7:15 am
by scottwilkerson
Depending on the OS you are running it usually is in /etc/init.d/nagios or /usr/lib/systemd/system/nagios.service

Re: Run a script at Core Startup

Posted: Tue Apr 09, 2019 4:54 pm
by grenley
Hi.
I meant to get back to you a while ago.
This worked great.
Thanks for your help!
Rick

Re: Run a script at Core Startup

Posted: Tue Apr 09, 2019 5:00 pm
by scottwilkerson
grenley wrote:Hi.
I meant to get back to you a while ago.
This worked great.
Thanks for your help!
Rick
No problem.

Locking thread

Re: Run a script at Core Startup

Posted: Tue Apr 09, 2019 5:00 pm
by cdienger
Glad to hear!