Security

Removing stale pid file... Can't unlink pid file "/opt/splunk/var/run/splunk/splunkd.pid": Permission denied

vnguyen46
Contributor

Hello,
I think there is a permission issue after my Linux system admin changed access to a directory.
Now my SH stopped. Either I run splunk status or start, I received the error message:
Removing stale pid file... Can't unlink pid file "/opt/splunk/var/run/splunk/splunkd.pid": Permission denied
My splunkd.pid file permission set as following:
-rwxrwxrwx. 1 splunk splunk 364 Apr 21 10:50 splunkd.pid

Anyone has resolved the same issue?

Thank you,

Labels (1)
0 Karma
1 Solution

PavelP
Motivator

Hello @vnguyen46,

as @renjith.nair mentioned, you have to check permission of folders.

Here are the permissions and owners of the pid file and folders of default install:

# namei -mo /opt/splunk/var/run/splunk/splunkd.pid
f: /opt/splunk/var/run/splunk/splunkd.pid
 dr-xr-xr-x root   root   /
 drwxr-xr-x root   root   opt
 drwx------ splunk splunk splunk
 drwx--x--- splunk splunk var
 drwx--x--- splunk splunk run
 drwx--x--x splunk splunk splunk
 -rw-r----- splunk splunk splunkd.pid

The permission set rwxrwxrwx (777 in octal notation) is applied usually to links and suid files only and should not be used.

View solution in original post

0 Karma

PavelP
Motivator

Hello @vnguyen46,

as @renjith.nair mentioned, you have to check permission of folders.

Here are the permissions and owners of the pid file and folders of default install:

# namei -mo /opt/splunk/var/run/splunk/splunkd.pid
f: /opt/splunk/var/run/splunk/splunkd.pid
 dr-xr-xr-x root   root   /
 drwxr-xr-x root   root   opt
 drwx------ splunk splunk splunk
 drwx--x--- splunk splunk var
 drwx--x--- splunk splunk run
 drwx--x--x splunk splunk splunk
 -rw-r----- splunk splunk splunkd.pid

The permission set rwxrwxrwx (777 in octal notation) is applied usually to links and suid files only and should not be used.

0 Karma

vnguyen46
Contributor

Thank you all. The issue was that the Linux admin renamed file splunkd.pid and assume this file would be recreated once Splunk restarted, but it didn't. Rename the file back to its original doesn't work, so this file needs to be manually recreated.

Thanks,

0 Karma

renjith_nair
Legend

@vnguyen46 ,
Make sure that the splunk user has permissions on the directory level as well.

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to January Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...