跳至內容
選單
此問題已被標幟
1 回覆
6022 瀏覽次數

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?



頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
6月 16
11874
0
3月 15
3970
0
3月 25
1042
0
6月 23
0
1
8月 22
2290