LinuxQuestions.org
Visit Jeremy's Blog.
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
  Search this Thread
Old 10-18-2007, 02:30 PM   #1
dbl8708
LQ Newbie
 
Registered: Oct 2007
Posts: 16

Rep: Reputation: 0
what command?


Hey, sorry but I have an easy request...

What is a command I can use to list the dependencies of a particular process?

In other words say I have a process (ProcessX) that I can see has a pid of 15854 using ps -elf | grep ProcessX...

What command can I use to list the processes that this process (ProcessX) is dependent on?

Thank you in advance.
 
Old 10-18-2007, 02:37 PM   #2
kav
Member
 
Registered: May 2006
Location: USA
Distribution: FreeBSD Ubuntu Debian
Posts: 137

Rep: Reputation: 15
That is a terrible thread name. You should have called it something like "list process dependencies command?" It would get read more, answered by someone smarter than me, and answered sooner.

What you might be looking for is the command 'pstree'.
 
Old 10-18-2007, 02:42 PM   #3
dbl8708
LQ Newbie
 
Registered: Oct 2007
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kav View Post
What you might be looking for is the command 'pstree'.

My system doesn't understand pstree. Do I have to run it from a specific directory?
 
Old 10-18-2007, 02:51 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
What do you mean by "depend on"? Processes may have a PPID (parent
process ID) which is your 5th column ... but that won't tell you
whether for example your spam filter depends on the working instance
of postgres.

To find that you'll have to follow the ldd <your executables> output,
and that will only tell you whether the "dependency" was compiled in,
and not whether it's actually required to be working.

That kind of "dependency" you'll only find out from looking at the
configuration of the process you're after. Over all you inquiry is
indeed badly worded :}


Cheers,
Tink
 
Old 10-18-2007, 02:54 PM   #5
kav
Member
 
Registered: May 2006
Location: USA
Distribution: FreeBSD Ubuntu Debian
Posts: 137

Rep: Reputation: 15
I an not in a position to tell you where things are in your system. You may or may not have pstree, I wouldn't know. Even if I knew what your system was I might not be familiar with it.

Tinkster is also right. We don't know if you mean compiled in dependencies or running dependencies. It might help to know what you actually need here and why.
 
Old 10-18-2007, 02:56 PM   #6
dbl8708
LQ Newbie
 
Registered: Oct 2007
Posts: 16

Original Poster
Rep: Reputation: 0
Ok, let me try to clarify my request

In windows you can do a sc qc ServiceX and it will list the other services that are required to be running in order for your selected service (ServiceX) to start.

Is there an equivalent command for linux?

Thank you, and sorry for the confusion.
 
Old 10-18-2007, 02:57 PM   #7
dbl8708
LQ Newbie
 
Registered: Oct 2007
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kav View Post
We don't know if you mean compiled in dependencies or running dependencies. It might help to know what you actually need here and why.
I have a process that won't start, I am trying to be able to tell if it is because a "dependent" service is failing. Just trying to follow the bread crumbs to find the root cause.

Thanks again.
 
Old 10-18-2007, 02:58 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by dbl8708 View Post
Ok, let me try to clarify my request

In windows you can do a sc qc ServiceX and it will list the other services that are required to be running in order for your selected service (ServiceX) to start.

Is there an equivalent command for linux?

Thank you, and sorry for the confusion.
Nope. Not per se. Some people may be adapting
solaris' svc command, which does something similar,
but I don't know who does. The distro's I'm currently
using don't.



Cheers,
Tink
 
Old 10-18-2007, 03:00 PM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by dbl8708 View Post
I have a process that won't start, I am trying to be able to tell if it is because a "dependent" service is failing. Just trying to follow the bread crumbs to find the root cause.

Thanks again.
What is that process, and when it "fails to start", does it
write anything away to logs? Also: which distro are you
using?


Cheers,
Tink
 
Old 10-18-2007, 03:00 PM   #10
dbl8708
LQ Newbie
 
Registered: Oct 2007
Posts: 16

Original Poster
Rep: Reputation: 0
Ok, thank you Tink.
 
Old 10-18-2007, 03:03 PM   #11
dbl8708
LQ Newbie
 
Registered: Oct 2007
Posts: 16

Original Poster
Rep: Reputation: 0
It is a proprietary process and logs only indicate that the process is not starting but don't list why. The only parent process listed is pid 1 which is init but I wasn't sure if init is the only "required" process to be running for this specific process to start.

Thank you for your help.
 
Old 10-18-2007, 03:08 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Well ... the next steps would be:

a)
ldd /path/to/your/process-executable ... see whether LIBRARIES it needs aren't
there.

b)
strace -o /tmp/logging /path/to/your/process-executable
and check whether strace reveals what the thing is trying to
do, and where or why it carks it .....



Cheers,
Tink
 
Old 10-18-2007, 03:09 PM   #13
kav
Member
 
Registered: May 2006
Location: USA
Distribution: FreeBSD Ubuntu Debian
Posts: 137

Rep: Reputation: 15
Are you typing it into a command line? If so post the exact output.

Or is it trying to start at boot and failing? If so you might find some bread crumbs in dmesg. That's where I look when things mysteriously don't start.

You would probably be better off consulting the vendor with this kind of problem, especially since you seem unwilling to reveal what this application is or what it might do.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 08:19 PM
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 03:23 AM
Redirecting output to a command-line argument of another command madiyaan Linux - Newbie 1 02-19-2005 05:35 PM
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 08:14 PM
Where is Command line utility for Cups and command tutorial mossy Linux - Software 8 01-16-2004 01:24 AM


All times are GMT -5. The time now is 02:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration