Greetings,
Hopefully I am posting in the right place, if not please let me know!
The goal is to run a python framework (odoo) as a service via daemon inside a jail. The topology is as follows:
[Internet] --> [Host] -- (pf)--> [Jail with HAProxy] --> [Jail with Odoo]
For reference, I am using vnet with epairs and a bridge. Only the host has pf rules, very simple setup to perform NAT and port forwarding.
I have downloaded the framework and got it to run after a bit of tinkering, to start it I run the command:
At this point I can see in the application log that everything was loaded correctly and I can access the application from within the jail (
So at this point all is good. The application is running, the network is working, the only thing missing is turning the application into a service with daemon.
I found an existing rc.d/odoo file which I have modified slightly, here it is for reference:
And this is where the problems begin. Although the service starts, it seems that it either hangs or it is not receiving requests at all.
I tried to narrow down the issue by starting the application with the following command:
Basically the same as thing as it was (successfully) done with the su command, but this time I get no reply from the server.
First of all, I reckon that the rc.d/odoo definition is not perfect and can be improved but shouldn't this work when running it through daemon?
I ran tcpdump from within the jail and I see the request arriving to the internal interface, but no activity at all in the application. Any ideas or suggestions on what to try? I don't know if I am missing something very obvious here.
Thank you for the assistance!
Hopefully I am posting in the right place, if not please let me know!
The goal is to run a python framework (odoo) as a service via daemon inside a jail. The topology is as follows:
[Internet] --> [Host] -- (pf)--> [Jail with HAProxy] --> [Jail with Odoo]
For reference, I am using vnet with epairs and a bridge. Only the host has pf rules, very simple setup to perform NAT and port forwarding.
I have downloaded the framework and got it to run after a bit of tinkering, to start it I run the command:
su -l odoo -c '/usr/local/odoo/odoo-bin -c /usr/local/etc/odoo.conf'
At this point I can see in the application log that everything was loaded correctly and I can access the application from within the jail (
fetch -qo - http://127.0.0.1:8069
), from the HAProxy jail and also from my web browser through the internet.So at this point all is good. The application is running, the network is working, the only thing missing is turning the application into a service with daemon.
I found an existing rc.d/odoo file which I have modified slightly, here it is for reference:
Bash:
#!/bin/sh
# PROVIDE: odoo
# REQUIRE: DAEMON postgresql
# KEYWORD: shutdown
. /etc/rc.subr
name=odoo
rcvar=odoo_enable
procname="python3.7"
pidfile="/var/run/odoo/${name}.pid"
logfile="/var/log/odoo/${name}.log"
load_rc_config $name
: ${odoo_conf_path:="/usr/local/etc/odoo.conf"}
command="/usr/sbin/daemon"
command_args="-u odoo /usr/local/odoo/odoo-bin -c ${odoo_conf_path} --pidfile=${pidfile} --logfile=${logfile}"
run_rc_command "$1"
And this is where the problems begin. Although the service starts, it seems that it either hangs or it is not receiving requests at all.
I tried to narrow down the issue by starting the application with the following command:
/usr/sbin/daemon -u odoo /usr/local/odoo/odoo-bin -c /usr/local/etc/odoo.conf
Basically the same as thing as it was (successfully) done with the su command, but this time I get no reply from the server.
First of all, I reckon that the rc.d/odoo definition is not perfect and can be improved but shouldn't this work when running it through daemon?
I ran tcpdump from within the jail and I see the request arriving to the internal interface, but no activity at all in the application. Any ideas or suggestions on what to try? I don't know if I am missing something very obvious here.
Thank you for the assistance!