Hi Keith,

I've dealt with similar situations by adding the sourcing of .venv/bin/activate to the etc/init.d/galaxy script. Then none of the pre-existing pid code needs to be changed.

-Will


On Tue, Nov 3, 2015 at 8:55 AM, Suderman Keith <suderman@cs.vassar.edu> wrote:
The solution was rather simple, once I figured it out.

The /etc/init.d/galaxy script was invoking scripts/paster.py script directly so .venv/bin/activate was not being sourced.  The solution was to modify /etc/init.d/galaxy to call a startup script that sourced .venv/bin/activate before starting Galaxy.  I can write my solution up in more detail, but now I am having some problems setting the pid file correctly.

If I use the --make-pidfile and --pidfile options for start-stop-daemon in /etc/init.d/galaxy then /var/run/galaxy.pid contains the pid of the startup script and not the pid of the Galaxy instance.

If I try to set the pid in the startup script Galaxy won't start as the script (now running as the Galaxy user) can't create/write the /var/run/galaxy.pid file.

My hack-around has been to touch the pid file (in case it doesn't exist) and then chown it to the galaxy user in /etc/init.d/galaxy, but this doesn't strike me as the correct way to do this.  Do any sysadmin gurus have any better suggestions?

Cheers,
Keith

> On Nov 1, 2015, at 9:31 PM, Keith Suderman <suderman@cs.vassar.edu> wrote:
>
> Greetings,
>
> I am trying to upgrade our Galaxy instance to the latest stable code from master and now our instance won't start using my /etc/init.d/galaxy script.  That is:
>
>> sudo service galaxy start
>
> no longer works. It says it does (i.e. prints "[OK]"), but Galaxy isn't running and nothing is written to the log. I am using the init.d script from simison [1], which is basically the same as the one posted to the Galaxy wiki [2], both of which are quite old.
>
> Galaxy does start with:
>
>> sudo su galaxy
>> ./run.sh --daemon
>
> so I have left Galaxy running in a screen session for now, but that is less than ideal.
>
> I suspect something to do with the .venv as `./run.sh --skip-venv` also fails and I don't recall Galaxy being that finicky about a venv being active. Does anyone know how I can get the /etc/init.d/galaxy script (i.e. start-stop-daemon) to activate the venv for paster.py?
>
> Cheers,
> Keith
>
> 1. http://simison.com/brian/GalaxyAdmin_notes.html
> 2. https://wiki.galaxyproject.org/Events/GCC2012/TrainingDay/WS5?highlight=%28init.d%29
>
> ------------------------------
> Research Associate
> Department of Computer Science
> Vassar College
> Poughkeepsie, NY
>
>
> ___________________________________________________________
> Please keep all replies on the list by using "reply all"
> in your mail client.  To manage your subscriptions to this
> and other Galaxy lists, please use the interface at:
https://lists.galaxyproject.org/
>
> To search Galaxy mailing lists use the unified search at:
http://galaxyproject.org/search/mailinglists/

___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/



--
The information contained in this e-mail message or any attachment(s) may be confidential and/or privileged and is intended for use only by the individual(s) to whom this message is addressed.  If you are not the intended recipient, any dissemination, distribution, copying, or use is strictly prohibited.  If you receive this e-mail message in error, please e-mail the sender at wholtz@lygos.com and destroy this message and remove the transmission from all computer directories (including e-mail servers).

Please consider the environment before printing this email.