Hi Niphlod, I had to modify the script by removing:

sudo -u <user> 

This would work if the user I required to run it did not require a sudo 
password, but I prefer all sudo actions to be authenticated.

Thank you again. 

ed

On Tuesday, 3 September 2013 08:01:33 UTC+2, lbd wrote:
>
> Thank you Niphlod, much appreciated.
>
>
>
>
> On Mon, Sep 2, 2013 at 4:04 PM, Niphlod <[email protected]> wrote:
>
>> description "myqueueprocessor"
>> start on (local-filesystems and net-device-up IFACE=eth0)
>> stop on shutdown
>> respawn limit 8 60 # Give up if restart occurs 8 times in 60 seconds.
>> exec sudo -u <user> python /path/to/your/script.py
>> respawn
>>
>>
>> put it in /etc/init/nameofyourservice.conf
>>
>> and it'll start as soon as the server is up. Additionally, it will 
>> respawn the process if it dies unexpectedly (up to a limit)
>> then, you can start it with the usual commands
>> sudo start nameofyourservice
>> sudo stop nameofyourservice
>> sudo status nameofyourservice
>> sudo restart nameofyourservice
>>
>>
>> On Monday, September 2, 2013 1:58:22 PM UTC+2, lbd wrote:
>>
>>> ...but how do you really feel about it ;-)
>>>
>>> Fair enough, will go the upstart route.
>>>
>>> Thank you
>>>
>>>
>>>
>>>
>>> On Mon, Sep 2, 2013 at 1:54 PM, Niphlod <[email protected]> wrote:
>>>
>>>>  no.no.no.no.no.no.
>>>> use services, and separate ones. If you're on ubuntu writing something 
>>>> for upstart is utterly easy.
>>>>
>>>>
>>>> On Monday, September 2, 2013 1:51:49 PM UTC+2, lbd wrote:
>>>>>
>>>>> Hi guys, I have my prod deployment of Ubuntu running nginx and in turn 
>>>>> web2py. Also thanks to Niphlod I have all HTTP req's rewritten to 
>>>>> https!!!! 
>>>>> I have an rq implementation in our code and would like to call 
>>>>> web2py-rq.py 
>>>>> or run sudo rqworker on the box. In my pre prod environment (no nginx) I 
>>>>> just add it to the web2py startup scripts so no problem.
>>>>>
>>>>> My question is where is the best place to do this when running from 
>>>>> nginx? I could run it as a separate process entirely, but would really 
>>>>> prefer it if it was started by the same script that nginx uses to start 
>>>>> web2py OR should I have it as a web2py "cron" job? Either way when nginx 
>>>>> starts web2py an rqworker needs to be started.
>>>>>
>>>>> What is cnsidered "best practice" 
>>>>>
>>>>> thanks
>>>>>
>>>>  -- 
>>>>  
>>>> --- 
>>>> You received this message because you are subscribed to a topic in the 
>>>> Google Groups "web2py-users" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/**
>>>> topic/web2py/oHhEU6irpL0/**unsubscribe<https://groups.google.com/d/topic/web2py/oHhEU6irpL0/unsubscribe>
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to 
>>>> web2py+un...@**googlegroups.com.
>>>>
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>
>>>  -- 
>>  
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/oHhEU6irpL0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to