This question has been flagged
3 Replies
5984 Views

Hi 

I am new to Bash. I need some help with running the POS startup script from the init.d script.

First part of the script

#!/bin/bash

### BEGIN INIT INFO

# Provides: odoo.py

# Required-Start: $remote_fs $syslog

# Required-Stop: $remote_fs $syslog

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: Start odoo daemon at boot time

# Description: Enable service provided by daemon.

# X-Interactive: true

### END INIT INFO

## more info: http://wiki.debian.org/LSBInitScripts

. /lib/lsb/init-functions

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin

DAEMON=/usr/bin/odoo.py

NAME=odoo

DESC=odoo

CONFIG=/etc/odoo/openerp-server.conf

LOGFILE=/var/log/odoo/odoo-server.log

PIDFILE=/var/run/${NAME}.pid

USER=odoo

export LOGNAME=$USER


In line 13 I need to replace 

odoo.py

with

odoo.py --load=web,hw_proxy,hw_posbox_homepage,hw_posbox_upgrade,hw_scale,hw_scanner,hw_escpos

Not sure what parenthesis to put in.

Please help.

Thanks in advance

Avatar
Discard

I don't know what do you want to achieve. Even https://www.odoo.com/documentation/8.0/reference/cmdline.html, there is no `--load` paramter. What is your purpose? Is that about start Odoo with POS module ready? If I am right, why don't you install an instance of Odoo and activate POS module? P/S: init scripts are different from OS to OS, (at least, on CentOS 7, it is shorter than on CentOS 6)

Best Answer

The solution:

In file /etc/odoo/odoo-server.conf

server_wide_modules = web,hw_proxy,hw_posbox_homepage,hw_scale,hw_escpos

In file /etc/init.d/odoo

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin

DAEMON=/opt/odoo/odoo.py

NAME=odoo

DESC=odoo

CONFIG=/etc/odoo/odoo-server.conf

LOGFILE=/opt/odoo/logs/odoo-server.log

PIDFILE=/var/run/${NAME}.pid USER=usuari

.....

function _start() {

    start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$USER --b ackground --make-pidfile --exec $DAEMON -- --config $CONFIG --logfile $LOGFILE

}

......




Avatar
Discard
Author Best Answer

Thank you for your response.

I am following the Posboxless installation on the do website https://www.odoo.com/documentation/user/9.0/point_of_sale/overview/setup.html

"

Start the local Odoo instance

We must launch the Odoo server with the correct settings

$ ./odoo.py --load=web,hw_proxy,hw_posbox_homepage,hw_posbox_upgrade,hw_scale, hw_scanner,hw_escpos

"

This sort of works from the command line the receipt printer prints the slip but I need to start it automatically. The Pos still cannot see the devices.

In addition I am now getting ESC/POS Error Access Denied

I am still very confused with this installation. 

Avatar
Discard