LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what command? (https://www.linuxquestions.org/questions/linux-newbie-8/what-command-592808/)

dbl8708 10-18-2007 01:30 PM

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.

kav 10-18-2007 01:37 PM

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'.

dbl8708 10-18-2007 01:42 PM

Quote:

Originally Posted by kav (Post 2928739)
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?

Tinkster 10-18-2007 01:51 PM

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

kav 10-18-2007 01:54 PM

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.

dbl8708 10-18-2007 01:56 PM

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.

dbl8708 10-18-2007 01:57 PM

Quote:

Originally Posted by kav (Post 2928761)
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.

Tinkster 10-18-2007 01:58 PM

Quote:

Originally Posted by dbl8708 (Post 2928764)
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

Tinkster 10-18-2007 02:00 PM

Quote:

Originally Posted by dbl8708 (Post 2928769)
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

dbl8708 10-18-2007 02:00 PM

Ok, thank you Tink.

dbl8708 10-18-2007 02:03 PM

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.

Tinkster 10-18-2007 02:08 PM

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

kav 10-18-2007 02:09 PM

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.


All times are GMT -5. The time now is 07:08 AM.