Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pserve --stop-daemon does not work with --monitor-restart #1216

Closed
arobinson opened this issue Jan 2, 2014 · 3 comments
Closed

pserve --stop-daemon does not work with --monitor-restart #1216

arobinson opened this issue Jan 2, 2014 · 3 comments

Comments

@arobinson
Copy link

If pserve is started with --monitor-restart, the command is restarted when pserve --stop-daemon is run and the pid file's process ID is not updated. The only way to seem to stop it is using kill on the process ID instead of relying on pserve.

@arobinson
Copy link
Author

pserve --pid-file /var/folders/9y/1x5r3v2x6c1_ng0m0s7n3s1c0007sc/T/tmpju6x4A --stop-daemon
Traceback (most recent call last):
  File "/Users/Shared/AndrewShared/Development/Python/env/bin/pserve", line 8, in <module>
    load_entry_point('pyramid==1.4', 'console_scripts', 'pserve')()
  File "/Users/Shared/AndrewShared/Development/Python/env/lib/python2.7/site-packages/pyramid/scripts/pserve.py", line 50, in main
    return command.run()
  File "/Users/Shared/AndrewShared/Development/Python/env/lib/python2.7/site-packages/pyramid/scripts/pserve.py", line 177, in run
    return self.stop_daemon()
  File "/Users/Shared/AndrewShared/Development/Python/env/lib/python2.7/site-packages/pyramid/scripts/pserve.py", line 467, in stop_daemon
    kill(pid, signal.SIGTERM)
OSError: [Errno 3] No such process

The pid_file contains "8814". Running a "ps" here are the processes running afterwards:

  UID   PID  PPID   C STIME   TTY           TIME CMD
 7980  8809     1   0 10:30AM ??         0:00.24 /Users/Shared/AndrewShared/Development/Python/env/bin/python /Users/Shared/AndrewShared/Development/Python/env/bin/pserve --pid-file /var/folders/9y/1x5r3v2x6c1_ng0m0s7n3s1c0007sc/T/tmpju6x4A --log-file /var/folders/9y/1x5r3v2x6c1_ng0m0s7n3s1c0007sc/T/tmpWMeX3m --daemon --reload --monitor-restart development.ini
 7980  9130     1   0 10:31AM ??         0:03.77 /Users/Shared/AndrewShared/Development/Python/env/bin/python /Users/Shared/AndrewShared/Development/Python/env/bin/pserve --pid-file /var/folders/9y/1x5r3v2x6c1_ng0m0s7n3s1c0007sc/T/tmpju6x4A --log-file /var/folders/9y/1x5r3v2x6c1_ng0m0s7n3s1c0007sc/T/tmpWMeX3m --daemon --reload --monitor-restart development.ini
 7980  9170  8809   0 10:31AM ??         0:00.20 /Users/Shared/AndrewShared/Development/Python/env/bin/python /Users/Shared/AndrewShared/Development/Python/env/bin/pserve --pid-file /var/folders/9y/1x5r3v2x6c1_ng0m0s7n3s1c0007sc/T/tmpju6x4A --log-file /var/folders/9y/1x5r3v2x6c1_ng0m0s7n3s1c0007sc/T/tmpWMeX3m --daemon --reload --monitor-restart development.ini

As you can see, the process has started with a new process ID

@piotr-dobrogost
Copy link

Just a note that you also use --reload which according to issue #912 is not supported when using --daemon.

@digitalresistor
Copy link
Member

@mmerickel and I have fixed the use of --monitor-restart with --daemon. Don't think it will work with --reload.

Either way, this feature is being deprecated.

mmerickel added a commit to mmerickel/pyramid that referenced this issue Nov 13, 2015
digitalresistor added a commit that referenced this issue Nov 13, 2015
fix usage of --monitor-restart with --daemon

Closes #1216
mmerickel added a commit to mmerickel/pyramid that referenced this issue Nov 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants