joe-at-startupmedia / pmon3

Golang Production Process Manager
10 stars 0 forks source link

pmon2 spawned applications have a ppid of 1 and not that of the pmond #8

Closed joe-at-startupmedia closed 10 months ago

joe-at-startupmedia commented 10 months ago
terrafo+  405882       1  0 09:03 ?        00:00:00 /home/terraform/go/src/pmon2/bin/test_server -h 10.132.204.203 -p 5556 -r 5001
terrafo+  405904       1  0 09:03 ?        00:00:00 /home/terraform/go/src/pmon2/bin/test_server -h 10.132.204.203 -p 5555 -r 5000
terrafo+  405927       1  0 09:04 ?        00:00:00 /home/terraform/go/src/pmon2/bin/test_server -h 10.132.204.203 -p 5556 -r 5003
root      405971       1  0 09:06 ?        00:00:00 /usr/local/pmon2/bin/pmond

This was replicable in the following scenarios:

  1. Starting the processes while pmond was active
  2. restarting pmond (pmon2.service) after
joe-at-startupmedia commented 10 months ago

killing the processed while pmond is running respawns the process with the appropriate ppid. further testing also reveals that pmond restarts do respawn the process with the correct ppid. This is most likely related to using the sudo command. however forking a process as non root user is currently not possible.

[terraform@puppet pmon2]$ pmon2 run bin/test_server --args "-h 10.132.204.203 -p 5555 -r 5000"
FATA fork/exec /home/terraform/go/src/pmon2/bin/test_server: operation not permitted
joe-at-startupmedia commented 10 months ago

https://github.com/joe-at-startupmedia/pmon3?tab=readme-ov-file#5-should-i-use-sudo-commands