Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to launch Odoo from ubuntu services using different virtualenv for each one?

By
Alejandro Santana
on 3/31/15, 4:08 AM 696 views

I usually launch Odoo using Ubuntu services like this, specially because they can be bound to system start:

service my_odoo_service_01 start

But for development I use several Odoo instances and with services I cannot activate a virtualenv and use it for each service. How do you manage it?

The service script I use for launching uses this to actually launch Odoo:

case "${1}" in
start)
      echo -n "Starting ${DESC}: "
      echo -n "Starting ${DAEMON} ${DAEMON_OPTS}"
     start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
          --chuid ${USER} --background --make-pidfile \
          --exec ${DAEMON} -- ${DAEMON_OPTS}
      sleep 1
      echo "${NAME}. PID: "`cat $PIDFILE`
      ;;

So, how can I use start-stop-daemon with virtualenv or virtualenvwrapper?

Or is there another way?



0

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 2/24/16, 4:11 PM

What worked for me is:in your init script, before calling start-stop-daemon insert:.

if [[ $VIRTUAL_ENV == "" ]];then

. /path/to/virtualenv/bin/activate

fi

in order to activate virtenv...

also in init script,

add path to your environment to PATH variable

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/31/15, 4:08 AM
Seen: 696 times
Last updated: 2/24/16, 4:11 PM