LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-29-2019, 08:52 PM   #1
nirvaanr
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian 10
Posts: 26

Rep: Reputation: Disabled
I can't run few processes as root but only as normal user.


Hi,

On CentOS 6.10, I couldn't run/start few processes (3rd party like x264, x265, Splunk etc.) as "root user" but no issues running them as a "Normal user". This is happening only on few machines in my environment. Is it some sort of security that was implemented on these boxes that prevents to be run/start as "root user"?

Please advise, Many thanks!!
 
Old 10-29-2019, 08:56 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
How precisely are you launching these processes, and what happens if you try launching them as root?

Are you sure that the same operating system and application software versions are installed on all systems in your environment? In other words, can you see differences between the configurations of the servers that exhibit the problem and servers that don't?

Last edited by berndbausch; 10-29-2019 at 08:58 PM. Reason: added second paragraph
 
Old 10-29-2019, 09:18 PM   #3
nirvaanr
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian 10
Posts: 26

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
How precisely are you launching these processes, and what happens if you try launching them as root?

Are you sure that the same operating system and application software versions are installed on all systems in your environment? In other words, can you see differences between the configurations of the servers that exhibit the problem and servers that don't?
Thanks berndbausch for your reply.

All machines are running CentOS 6.10 with selinux in "permissive" mode (i checked on each machine) with same patch level etc. There might be (not sure) slight (don't know what they are) config changes as they were built by another team.

When I run splunk ("/opt/splunkforwarder/bin/splunk") as root user it just stucks/hangs (waited for an hour or so) and the only way is to stop it by ctrl-C or close the putty session. Splunk won't start. But same thing I can run as "splunk" user (normal user) without any issues.

I think it might be some security settings.

Please advise!
 
Old 10-29-2019, 11:18 PM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
There is no way to generally prevent root from running certain programs (except mandatory access control, i.e. SELinux, which we can exclude here, and AppArmor, which is unlikely to be enabled on Centos).

So I am thinking that this problem is caused by some Splunk configuration. I hoped you would get an error message on the command line. Since this is not the case, are there log files you could check? Is there a verbose or debug option when launching splunk (sadly I know very little about Splunk)?
By the way, shouldn't you run splunk with the start parameter?

If all else fails, you can run the command under strace. strace will show you the system calls that the process issues, which might give you a clue. For example, it shows you the files it attempts to open, and whether they were opened successfully or not. Be prepared for a lot of output.
 
Old 10-30-2019, 04:04 PM   #5
nirvaanr
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian 10
Posts: 26

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
you can run the command under strace. strace will show you the system calls that the process issues, which might give you a clue.
Thanks again. Yes, we need to run it with start/stop/status parameters which i am doing correctly.

As you suggested, I used strace along with splunk by running
Quote:
strace -o /tmp/strace.out /opt/splunkforwarder/bin/splunk status
and it never returned to prompt but writing continuously to /tmp/strace.out which has lots of "timeouts". I also ran the same as splunk user which ran in fraction of second without any issues. I attached both strace logs, Please see advise, thank you!!
Attached Files
File Type: txt splunk_status_as_ROOT_user_struss-log.txt (52.2 KB, 13 views)
File Type: txt splunk_status_as_splunk_user_struss-log.txt (10.2 KB, 10 views)
 
Old 10-30-2019, 07:10 PM   #6
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The two traces diverge around lines 110-120 after the call to getuid(). The non-root version then checks for the presence of some files under /opt/splunkforwarder and seems to execute the splunk daemon.

The root version does something totally different. Rather than looking at /opt/splunkforwarder, it opens a UNIX socket named /var/lib/samba/winbindd_privileged/pipe and reads from it in an endless loop. It seems that it reads as long as data is available at this socket, and data seems to be available all the time. Some of that data is ASCII, such as radiocymruprog (Welsh radio program? I am curious!), cas_assetreg, rad_rdincome, radcym_head (more Welsh) etc.

Judging from the socket's name, it's obviously part of Samba, the open-source version of Windows share server, and it references Winbind, which is some sort of name resolution protocol in Windows share environments.

My guess is that the problem only occurs on servers where Samba and/or Windbind are configured, or where Splunk is configured to do something with Winbind. But that's all I can offer with the information given.

Last edited by berndbausch; 10-30-2019 at 07:12 PM.
 
Old 10-31-2019, 02:57 AM   #7
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,845

Rep: Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222
Do you have winbind in /etc/nsswitch.conf? Then ensure there is files before winbind.
 
Old 10-31-2019, 10:00 AM   #8
nirvaanr
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian 10
Posts: 26

Original Poster
Rep: Reputation: Disabled
Thanks berndbausch & MadeInGermany

Quote:
Originally Posted by MadeInGermany View Post
Do you have winbind in /etc/nsswitch.conf? Then ensure there is files before winbind.
It seems "files" given priority over winbind

Code:
[root@TESTSVR ~]#  grep -i winbind /etc/nsswitch.conf
passwd:     files  winbind
shadow:     files  winbind
group:      files  winbind
services:   files winbind
sudoers:    files winbind [NOTFOUND=return UNAVAIL=return] db
[root@TESTSVR ~]#  grep -i host /etc/nsswitch.conf
#hosts:     db files nisplus nis dns
hosts:      files dns
[root@TESTSVR ~]#
I also tried the Latest version of Splunk Forwarder and the behaviour is same.

Last edited by nirvaanr; 10-31-2019 at 10:08 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] BLFS 9.0systemd can't change passwds But can login with root and normal user rabidlinux Linux From Scratch 1 09-04-2019 01:45 PM
is it possible that normal user should not able to remove crontab which was set by superuser for this normal user? gjoshi Linux - Newbie 1 04-02-2019 12:30 AM
How to run daemon process being a normal user [not root user]. narendra1310 Linux - Software 1 10-26-2009 09:48 AM
Root can't open display, but normal user can? sw67 Slackware 6 06-05-2005 11:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration