WebFaction
Community site: login faq

I'm trying to figure out a way to run a consumer function in HotQueue to process some tasks: http://richardhenry.github.com/hotqueue/

How would I go about setting that up so that it doesn't terminate when I exit out of SSH?

asked 28 Nov '12, 16:38

aa56280
131714
accept rate: 0%


If you need to keep Redis running, instructions are here: Run redis in background?

If you have a Python script using HotQueue and you need to keep that running, then you might be able to do so by:

  • Use nohup and run the script in the background, eg: nohup python2.7 myscript.py >> ~/logs/user/myscript.log 2>&1 &, or...
  • Daemonize it: Creating a daemon the Python way, or..
  • Run it in a screen session and detach from the session, or..
  • Use a monitoring daemon like supervisord to keep it running, or..
  • (anybody else?)
permanent link

answered 29 Nov '12, 12:58

seanf
12.2k41836
accept rate: 37%

I went with nohup python my_file.py > /dev/null 2>&1&

This doesn't produce a nohup.out file

permanent link

answered 28 Dec '12, 12:47

aa56280
131714
accept rate: 0%

To output to a log you need to add a log direct instead of directing to /dev/null, for example:

nohup python my_file.py >> ~/logs/user/my_file.log 2>&1 &

This will send to a log file at the path ~/logs/user/my_file.log

(28 Dec '12, 14:31) timg ♦♦

Thanks for the tip.

(28 Dec '12, 15:00) aa56280
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:

×909
×337

question asked: 28 Nov '12, 16:38

question was seen: 2,546 times

last updated: 28 Dec '12, 15:00

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