[ckan-dev] Virtualenv tips: how to reload the ini file

Jason Tan jason.tan at ersa.edu.au
Fri Jun 13 02:53:27 UTC 2014


HI John,

I'm not 100% sure what you're trying to do here, but if you want an
existing running paster instance to reload it's config file you could *try*:
kill -HUP <paster_process_id>

That sends a hangup signal to the prociess identified by
<paster_process_id> .
Most unix daemons will re-read and reload their config when they receive a
SIGHUP.
I'm not sure about python/paster, but it is probably worth a try - if that
is what you are trying to do.

As to being able to join and run an existing session - you could run paster
in a screen session.
screen is a utility that allows you to run a command, log out of your
session and have the command continue exiting.
Later on you can return to the session.

I don't think this is really the right answer, but you could try it until
the right answer presents itself.

To run screen (assuming it is installed on your server) putty into your
server as normal.
At the point you want to run the paster server type:
screen

run your commands
then type
ctrl-a d
That will log you out of the screen session, however the screen session and
the commands exectuing in it will keep executing.
You can if you want then log out of putty.

Later on you can log back into the server and run
screen -ls
E.g.
that should list all the screen sessions that are running for your user.
Then type:
screen -r <session>




Jason



On 12 June 2014 14:31, John Brisbin <john at boab.info> wrote:

> G'Day all,
>
> Thanks to some kindly orientation help from Jason Tan, I have managed to
> get python to reload the development.ini file and proceed onward on the
> path to creating a custom theme....but not without some lingering confusion.
>
> This is a request for advice on how to manage the virtualenv sessions
> properly.
>
> Starting from a fresh PuTTY login, I run $ netstat -lntp and can see that
> there's an existing Python process on a given PID (let's say 4506)
>
> (1) If I open another shell, activate a virtualenv (.
> /usr/lib/ckan/default/bin/activate), and try to run the paster command:
>
> paster serve --reload /etc/ckan/default/development.ini
>
> we will get the message that the server is starting in some other socket
> (eg 5304), and then will get the socket Errno 98 Address already in use.
>
> (2) If I kill the python process manually, and then re-run the paster
> command, the server appears to reload the ini file and start itself
> normally.
>
> It doesn't seem right that I have to manually kill Python before being
> able to run the --reload, but, given that Python should always be running,
> and I don't know how to join (or leave) an existing virtualenv session, I'm
> not sure what else to do.
>
> Thanks for any pointers!
>
> Kind regards,
>
> JB
>
>
>
> --
> John Brisbin
> Managing Director, BoaB interactive Pty Ltd
> POB 248, MT Molloy QLD 4871
>
> E: john at boab.info
> M: 0407 471 565 | P: 07 4094 2172
> Skype: boabjohn | Twitter: @boabjohn
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>



-- 
Jason Tan
Data Infrastructure Specialist, eResearch SA

phone: +61 8 8313 2184
Mob: +61 407 268 270
email: jason.tan at ersa.edu.au
web: http://www.ersa.edu.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140613/3be8bee3/attachment-0003.html>


More information about the ckan-dev mailing list