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
SplunkTrust
SplunkTrust

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

Happy Splunking!
0 Karma
Get Updates on the Splunk Community!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...