eye icon indicating copy to clipboard operation
eye copied to clipboard

check_identity cannot be disabled

Open grimm26 opened this issue 5 years ago • 4 comments

I set check_identity false on a process and its pidfile is still monitored for changes. I tested by echoing a new PID into its pidfile:

24.09.2018 16:18:12 WARN  -- [helios:helios] check_alive: pid_file (/var/run/helios/helios.pid) changed by itself (<4189> => <4188>), reverting to <4189> (the pid_file is controlled by eye)

Shouldn't setting check_identity to false prevent this behavior?

grimm26 avatar Sep 24 '18 16:09 grimm26

check_identity should disable this, i not see in code anything else. are you sure that config loaded and process have this option? (eye x -c) btw, why process change pid_file?

kostya avatar Sep 24 '18 16:09 kostya

deployment@stg:~$ eye xinfo -c  | grep check_identity                                                                                                                                                                             
  :check_identity: true                                                                                                                                                                                                                  
  :check_identity_period: 60                                                                                                                                                                                                             
  :check_identity_grace: 60
deployment@stg:~$ eye l
Config loaded!
deployment@stg:~$ eye xinfo -c  | grep check_identity                                                                                                                                                                             
  :check_identity: false
deployment@stg:~$ echo 4188 > /var/run/helios/helios.pid ; eye trace
....
24.09.2018 16:50:49 WARN  -- [helios:helios] check_alive: pid_file (/var/run/helios/helios.pid) changed by itself (<4189> => <4188>), reverting to <4189> (the pid_file is controlled by eye)

grimm26 avatar Sep 24 '18 16:09 grimm26

As for why change process PID file, this is related to https://github.com/kostya/eye/issues/187

I have a process that does not daemonize itself but does its own graceful restart on a USR2 signal. It replaces itself with a new process and manages its own PID file.

grimm26 avatar Sep 24 '18 16:09 grimm26

yes, i finded, this is not related to check_identity, this just how managed pid_file with daemonize true, need to think what to do here, maybe add another option: trust_pid_file_change true

kostya avatar Sep 24 '18 17:09 kostya