LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 10-25-2013, 05:55 AM   #1
supasoaker
Member
 
Registered: Nov 2008
Posts: 47

Rep: Reputation: 16
How to tell if a program is running User Side or not?


Well, the question is pretty much in the title. I have searched around and looked in some books but cannot find reference to this.

Is it possible to tell if a program is running User Side? Is it also possible to monitor if a program asks for and gets access to the kernel side or not?

Sorry if my terminology is a little off, please let me know if you need me to rephrase.

Related Issue: Anyone have any links to information about scheduling in Linux and maybe even how it can be modified? Maybe not a best practice, but interesting to be aware of. I have found this link below but am unsure if it will change the scheduling system for the ENTIRE system:

http://linuxmanpages.net/manpages/fe...heduler.2.html

I can read but am looking for confirmation, sorry for the two part question. Thanks in advance for any help!
 
Old 10-25-2013, 07:47 AM   #2
rtmistler
Member
 
Registered: Mar 2011
Location: Milford, MA. USA
Distribution: MontaVista, Ubuntu, MINT
Posts: 743
Blog Entries: 6

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
To try to answer the first part of the question which is to know whether or not a program is running, it depends on the environment from which you are querying. I.e. from the shell you can perform a search for the process using the "ps" command with arguments. You can also search for the command line of that program under the /proc tree, and likely that is how I'd progress if I did it via a program. I'd write a bash script, passing it a name argument; intended to be the process name I was searching for, perform the shell based searching actions in that script and return to my calling program, the result.

As far as the kernel access goes, I'm kind of weak on that except if I were coding the process I could add debug to let me know this. I'll have to leave this part up to another responder.
 
Old 10-28-2013, 05:49 PM   #3
bill_from_tampa
LQ Newbie
 
Registered: Jan 2005
Location: Tampa
Distribution: Debian testing
Posts: 20

Rep: Reputation: 3
One way: run a program called "htop" in a console. It is an expanded version of "top". It will list all running programs (you can space down) and gives much info about each one, including which user ran it. You can find any specific program using the F4/find command within htop. Note that "root" is the name of the superuser in linux, so programs with root as the user have superuser permissions. Operating system programs launched by the kernel or a kernel module would run as "root", but you could also run a program as "root" bu using su or sudo to launch it. I hope this is what you were asking about!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Running program as user with no shell arashi256 Linux - Newbie 16 06-01-2010 03:34 AM
Running a Samba & AD domain side-by-side DanW85 Linux - Server 0 12-09-2009 10:37 AM
running program remotely on different user learnq Linux - Server 6 03-24-2008 08:23 PM
Filecopy Using Sockets Without Explicitly Running Server Side Program. chaits Linux - Networking 3 03-11-2004 02:08 AM
problem running program as user FlAWD Linux - General 1 10-15-2003 07:31 AM


All times are GMT -5. The time now is 11:25 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration