WebFaction
Community site: login faq

Hi, Team I'm trying to run a bottle app with cherry Server .all configuration done . I'm tring to let the webapp run even I could down my ssh session .so I run below code to run a deamon :

from cherrypy import wsgiserver,process,engine from index import app # my app here d = wsgiserver.WSGIPathInfoDispatcher({'/': app}) server = wsgiserver.CherryPyWSGIServer(('127.0.0.1', 31623), d)

de = process.plugins.Daemonizer(engine) de.subscribe()

if name == 'main': try: server.start() except KeyboardInterrupt: server.stop()

Now I can visit my website now ,but how to restart my cherrypy server after I modified my webapp files ? for now , my online website seems no change even I upload my modified souce file to server .

Pls kindly help ,thank you very much .

asked 01 Oct '11, 06:56

MOY
134
accept rate: 0%


Hi,

Since you have a daemon running, you can try killing it from the shell using the 'kill' command. It's hard to guess further than this without looking at your actual account/setup. If you cannot figure it out, could you please open a ticket about this?

permanent link

answered 01 Oct '11, 07:06

todork
1.2k5
accept rate: 34%

This will do it:

ps -u [your user name] -o pid,rss,command | awk '{print $0}{sum+=$2} END {print "Total", sum/1024, "MB"}'

returns something like:

  PID   RSS COMMAND
 5874  1800 sshd: djotjog@pts/10
 5900  1904 -bash
 7598  1132 ps -u djotjog -o pid,rss,command
 7608   956 awk {print $0}{sum+=$2} END {print "Total", sum/1024, "MB"}
 8217 18164 /usr/local/bin/python2.7 /home/djotjog/webapps/cherrypy/site.py
24262  1140 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
Total 24.5078 MB

[path]$ kill 8127 that will kill it and the next time someone loads a web page it will restart. You'll need to reload your URL twice after killing it.

permanent link

answered 20 Nov '12, 10:25

marcmaxson
33
accept rate: 0%

[path]$ kill 8217

you transposed the digits

(16 Apr '13, 08:34) Christiansen

you can also put a function inside the cherrypy site.py that when the webpage URL is loaded, it automatically restarts the server. I did that and included a password in the url so that not just anyone could restart the server.

permanent link

answered 07 Aug '13, 11:14

marcmaxson
33
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×32
×24
×10

question asked: 01 Oct '11, 06:56

question was seen: 7,789 times

last updated: 07 Aug '13, 11:14

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM