| | |
| | | raise ValueError(msg) |
| | | writeable_pid_file.close() |
| | | |
| | | if getattr(self.options, 'daemon', False): |
| | | if ( |
| | | getattr(self.options, 'daemon', False) and |
| | | not os.environ.get(self._monitor_environ_key) |
| | | ): |
| | | self._warn_daemon_deprecated() |
| | | try: |
| | | self.daemonize() |
| | |
| | | return 2 |
| | | |
| | | if ( |
| | | not os.environ.get(self._monitor_environ_key) and |
| | | self.options.pid_file |
| | | ): |
| | | self.record_pid(self.options.pid_file) |
| | | |
| | | if ( |
| | | self.options.monitor_restart and |
| | | not os.environ.get(self._monitor_environ_key) |
| | | ): |
| | | return self.restart_with_monitor() |
| | | |
| | | if self.options.pid_file: |
| | | self.record_pid(self.options.pid_file) |
| | | |
| | | if self.options.log_file: |
| | | stdout_log = LazyWriter(self.options.log_file, 'a') |