File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -610,7 +610,7 @@ def main(argv):
610610 return
611611 except (Exception , IOError ) as e :
612612 logger .details ('%s' , MSG ['IntError' ].format (str (e )))
613- logger .errort (MSG ['CollectorErr' ])
613+ logger .error (MSG ['CollectorErr' ])
614614 return
615615 except (OSError ) as e :
616616 logger .details ('%s' , MSG ['IntError' ].format (str (e )))
@@ -664,7 +664,11 @@ def main(argv):
664664 try :
665665 cherrypy .engine .start ()
666666 logger .info ("server started" )
667- logger .debug ("Server started PID: {}" .format (os .getpid ()))
667+ with open ("/proc/{}/stat" .format (os .getpid ())) as f :
668+ data = f .read ()
669+ foreground_pid_of_group = data .rsplit (" " , 45 )[1 ]
670+ is_in_foreground = str (os .getpid ()) == foreground_pid_of_group
671+ logger .debug ("Server PID: {}. Process started in the foreground: {}" .format (os .getpid (), is_in_foreground ))
668672 cherrypy .engine .block ()
669673 except TypeError as e :
670674 logger .error ("Server request could not be proceed. Reason: {}" .format (e ))
You can’t perform that action at this time.
0 commit comments