Monitoring Splunk

Can run splunkd in foreground?

Path Finder

Some integration reason I need to run application in foreground by another agent in my company.
Is it a way to run Splunk in foreground?

Tags (1)
1 Solution

Splunk Employee
Splunk Employee

Easy: splunk start splunkd --nodaemon

View solution in original post

Splunk Employee
Splunk Employee

Easy: splunk start splunkd --nodaemon

View solution in original post

Splunk Employee
Splunk Employee

I downvoted this post because this is not an advisable recommendation for production use.

0 Karma

Engager

But why not?

This should be the best-supported way to run splunk. All standard linux pid-1 inits work better with foreground processes because it's easy to detect when the process has exited. You have to go to considerable trouble to make them monitor background processes correctly.

I'm still getting over the fact that splunk doesn't actually ship with any sysvinit-style (or upstart or sysctld...) init scripts.

0 Karma

Path Finder

How stable splunkd is in foreground. As such there is no official documentation stating this parameter.

I have faced such scenarios, if you may suggest something -
https://answers.splunk.com/answers/189019/why-splunkd-is-exiting-with-retrun-code-2-when-run.html

0 Karma

Splunk Employee
Splunk Employee

Indeed, --nodaemon involves a few changes in behavior, such as not changing the current directory (to /), which means the current directory of splunkd will be whatever you launched it with, safe or not. You won't be happy if you unmount the filesystem splunkd has as a current directory, for example.

We also do not QA splunkd with this flag. It's intended for testing, troubleshooting and development.

0 Karma

Path Finder

I asked splunk support. Nothing we can do about this.

0 Karma

Did you find a solution or workaround to do this?

0 Karma

Path Finder

You're really not explaining why you want to run it in the foreground. What is the actual problem you are attempting to solve, that you think having splunkd in the foreground would help?

Path Finder

Are you sure the application management agent cannot accept the fact that the app goes into daemon mode on its own, and simply issue the 'restart' option if the process dies?

0 Karma

Path Finder

There's a application management agent from my company that would start/stop app and monitor the process status actively. They're using it to run application into background mode. As I know if Splunk is in background already, somehow it would lose control of the process.

0 Karma

Path Finder

Nothing special actually. I just want to know if I can run Splunk in foreground instead of daemon. Like most of the other applications that we can make the choice

0 Karma

Influencer

Perhaps more details of the scenario would help...

0 Karma