From 56536055154350da4b9314eed1235b329737cf72 Mon Sep 17 00:00:00 2001 From: ljf Date: Mon, 21 May 2018 10:51:03 +0200 Subject: [PATCH] [fix] Missing bc dependencies --- conf/odoo.service.j2 | 14 ++++++++++++++ scripts/_common.sh | 11 ++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 conf/odoo.service.j2 diff --git a/conf/odoo.service.j2 b/conf/odoo.service.j2 new file mode 100644 index 0000000..b832e5d --- /dev/null +++ b/conf/odoo.service.j2 @@ -0,0 +1,14 @@ +[Unit] +Description=Odoo +After=network.target + +[Service] +Type=simple +User=odoo +Environment=PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin +ExecStart=/usr/bin/odoo.py --config {{ conf_file }} > /var/log/odoo/odoo-server.log 2>&1 +Restart=always +RestartSec=3 + +[Install] +WantedBy=multi-user.target diff --git a/scripts/_common.sh b/scripts/_common.sh index 2228359..212e110 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,11 +8,11 @@ function define_paths() { # In odoo 10 some file change if [ $(echo "$odoo_version >= 10" | bc) -ne 0 ]; then export source_path=/usr/lib/python2.7/dist-packages/odoo/ - conf_file=/etc/odoo/odoo.conf + export conf_file=/etc/odoo/odoo.conf bin_file=/usr/bin/odoo else export source_path=/usr/lib/python2.7/dist-packages/openerp/ - conf_file=/etc/odoo/openerp-server.conf + export conf_file=/etc/odoo/openerp-server.conf bin_file=/usr/bin/openerp-server fi } @@ -70,7 +70,7 @@ function install_dependencies() { if [ ! -f /etc/apt/sources.list.d/odoo.list ]; then # Install Odoo # Prepare installation - ynh_package_install curl + ynh_package_install curl bc # Install Odoo curl -sS https://nightly.odoo.com/odoo.key | sudo apt-key add - @@ -106,9 +106,14 @@ function add_services() { yunohost service add postgresql fi if ! grep "^odoo:$" /etc/yunohost/services.yml; then + ynh_configure odoo.service /etc/systemd/system/odoo.service + rm /etc/init.d/odoo + yunohost service add odoo --log /var/log/odoo/odoo-server.log yunohost service stop odoo yunohost service start odoo + yunohost service enable odoo + systemctl enable odoo fi }