ubc-systopia / Indaleko

Indaleko Project
GNU Affero General Public License v3.0
0 stars 1 forks source link

Getting execution path of a command using ps #53

Open hadisinaee opened 5 months ago

hadisinaee commented 5 months ago

This is the updated version 2 introduced in up to this commit 964f37f9ed28bc7b148512218dfe4ad01d1ea9d9

{
  "pid": "61754",
  "proc": "Code Helper (Plugin",
  "exec_path": "",
  "events": [
    {
      "fname": "[[UNKNOWN]]",
      "open": "",
      "close": "23:18:42.569602",
      "mode": 3
    },
    {
      "fname": "[[UNKNOWN]]",
      "open": "",
      "close": "23:18:42.569618",
      "mode": 0
    },
    {
      "fname": "[[UNKNOWN]]",
      "open": "",
      "close": "23:18:42.569622",
      "mode": 0
    },
    {
      "fname": "[[UNKNOWN]]",
      "open": "",
      "close": "",
      "mode": 3
    }
  ]
}

The issue here is locating the exec_path of the running process with a specific pid.

To find the execution path for a specific command, I used ps -A -o pid,command. This only shows the pid and the command part of all running processes. If we have a specific process id, we're interested in its command part for our data. However, I couldn't retrieve the full command using this method. The problems were: