3

There is a vmware api which can return the pid and exit code of executed processes. Some how I am getting only the pid but not the exit code(may be due to unsupported guest os).

Generally it returns the out put like this :

   name = 'chmod',
   pid = 2377,
   owner = 'reuben',
   cmdLine = '"/bin/chmod" +x /home/reuben/some_script.sh',
   startTime = 2014-10-14T07:31:07Z,
   endTime = <unset>,
   exitCode = <unset>

As you can see I am not getting the exit code. But it works with other supported guest OS.

Note: though it is not returning the exit code but the process is finishing successfully.

So is there any unix command to know the exit code from the pid ?

Reuben
  • 5,556
  • 10
  • 43
  • 55
  • possible duplicate of [Linux, where are the return codes stored of system daemons and other processes?](http://stackoverflow.com/questions/18441760/linux-where-are-the-return-codes-stored-of-system-daemons-and-other-processes) – Tom Zych Oct 14 '14 at 08:17
  • @TomZych It looks WMWare specific, so I don't think it's a duplicate of that question. – l0b0 Oct 14 '14 at 09:13
  • That would not make sense. After process termination the PID may be reused, that is, it would be a non-deterministic query. So it must involve some logging facility, which at least records the pid, the termination time and the exit code of the process, to achieve such a functionality. I have an idea how to create one, but it's far beyond the bounds of this question. – Géza Török Oct 14 '14 at 10:23

0 Answers0