Closed DocCyblade closed 8 years ago
I made some quick changes on a stable build (https://github.com/DocCyblade/tkl-odoo/tree/ab26c4d3663dea28e687cffbe4a6f09c80590417) and seemed to be able to get the pid working under Odoo!
Testable or should I wait a bit?
Changes made to get this to work. @JedMeister - this look good to you? Seems work
/var/run/openerp-server.pid
ls -l /var/run/openerp-server.pid
-rw-rw-r-- 1 openerp root 4 Oct 8 02:52 /var/run/openerp-server.pid
/etc/odoo/openerp-server.conf
with pid file location#-----------------------------------------------------------------------------
# The file where the server pid will be stored (default False).
#-----------------------------------------------------------------------------
pidfile = /var/run/openerp-server.pid
/etc/init.d/openerp-server
init script to remove option to create the file....
case "${1}" in
start)
echo -n "Starting ${DESC}: "
echo "`date` - Starting ${DESC}: " >> ${DAEMON_LOGFILE}
start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \
--chuid ${USER} --background --no-close \
--exec ${DAEMON} -- --config=${CONFIG} >> ${DAEMON_LOGFILE} 2>&1
echo "${NAME}."
;;
...
restart|force-reload)
echo -n "Restarting ${DESC}: "
echo "`date` - Restarting ${DESC}: " >> ${DAEMON_LOGFILE}
echo "`date` - Stopping ${DESC}: " >> ${DAEMON_LOGFILE}
start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid \
--oknodo
sleep 15
echo "`date` - Starting ${DESC}: " >> ${DAEMON_LOGFILE}
start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \
--chuid ${USER} --background --no-close \
--exec ${DAEMON} -- --config=${CONFIG} >> ${DAEMON_LOGFILE} 2>&1
echo "${NAME}."
;;
@l-arnold - Not yet, want to get @JedMeister thoughts on the above
Here is some "snap shots" of console commands that seem to point that the above works well.
systemctl status openerp-server.service
* openerp-server.service - LSB: Open Enterprise Resource Management software
Loaded: loaded (/etc/init.d/openerp-server)
Active: inactive (dead) since Thu 2015-10-08 03:10:03 UTC; 19s ago
Process: 5924 ExecStop=/etc/init.d/openerp-server stop (code=exited, status=0/SUCCESS)
Process: 5856 ExecStart=/etc/init.d/openerp-server start (code=exited, status=0/SUCCESS)
Oct 08 03:09:14 tkl-odoo systemd[1]: Starting LSB: Open Enterprise Resource Management software...
Oct 08 03:09:14 tkl-odoo openerp-server[5856]: Starting openerp-server: openerp-server.
Oct 08 03:09:14 tkl-odoo systemd[1]: Started LSB: Open Enterprise Resource Management software.
Oct 08 03:10:03 tkl-odoo systemd[1]: Stopping LSB: Open Enterprise Resource Management software...
Oct 08 03:10:03 tkl-odoo openerp-server[5924]: Stopping openerp-server: openerp-server.
Oct 08 03:10:03 tkl-odoo systemd[1]: Stopped LSB: Open Enterprise Resource Management software.
tail /var/run/openerp-server.pid
5860
systemctl start openerp-server.service
systemctl status openerp-server.service
* openerp-server.service - LSB: Open Enterprise Resource Management software
Loaded: loaded (/etc/init.d/openerp-server)
Active: active (running) since Thu 2015-10-08 03:10:43 UTC; 3s ago
Process: 5924 ExecStop=/etc/init.d/openerp-server stop (code=exited, status=0/SUCCESS)
Process: 5997 ExecStart=/etc/init.d/openerp-server start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/openerp-server.service
|-6001 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-6016 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-6017 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-6018 /usr/bin/python /opt/openerp/odoo/openerp-gevent --config=/etc/odoo/openerp-server.conf
|-6019 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
`-6020 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
Oct 08 03:10:43 tkl-odoo openerp-server[5997]: Starting openerp-server: openerp-server.
Oct 08 03:10:43 tkl-odoo systemd[1]: Started LSB: Open Enterprise Resource Management software.
tail /var/run/openerp-server.pid
6001
The commit you link to above seems to only be changes related to the logging? I'm guessing that this is 2 separate things we're talking about? I.e. Logging and PID file - Regardless it sounds fair and reasonable to me and if it works - it works!
@l-arnold - Pushed the changes, want to give it a spin?
@JedMeister - The commit I referred to was not the commit it's self but snap shot in time.
Make clean && make (lets see where it goes. Reports likely in the morning) Thanks!
@DocCyblade Ah ok...
Pushed fix, pid file needs to be located in /var/run/odoo/openerp-server.pid
Also Odoo should be started see https://github.com/DocCyblade/tkl-odoo/issues/44#issuecomment-146406797 to see how I tested it.
tested with what should be up to date... *(mentioned in separate issue #45 )
no folder /var/run/odoo no pid file
Ok, will check on my end. Building now
Looks like source would have PID in
/var/run/openerp-server.pid
not there.
logs would be in /var/logs/odoo/openerp-server.log also not there on build.
Should there be an ownerhip statement around: /conf.d/main Create PID file touch /var/run/openerp-server.pid
@l-arnold - Issue I think from the start is, the init script needs to manage the pid file or if we are creating the folder in /var/run we need to do it from the init script since /var/run is a temp file system. Made the changes. I got to run won't her back until late tonight. This should fix the pid problem once and for all. (i think)
As I just posted elsewhere: So it sounds like either you'll want to let the service file (i.e. via start-stop daemon) handle the pid file; or put odoo's PID file somewhere in /opt/odoo; maybe /opt/odoo/run...
Or like you say the init file could create it and set the required permissions. That'd be fine IMO. If you use the -p
switch on mkdir
it won't error if the directory already exists...
current state of dev-rc1 seems to work even after first boot.
root@tkl-odoo ~# ls -l /var/run
...
drwxrwxr-x 2 openerp root 60 Oct 12 18:58 odoo
...
root@tkl-odoo ~# ls -l /var/run/odoo
-rw-r--r-- 1 openerp openerp 4 Oct 12 18:58 openerp-server.pid
root@tkl-odoo ~# systemctl stop openerp-server.service
root@tkl-odoo ~# systemctl status openerp-server.service
* openerp-server.service - LSB: Open Enterprise Resource Management software
Loaded: loaded (/etc/init.d/openerp-server)
Active: inactive (dead) since Mon 2015-10-12 19:35:14 UTC; 8s ago
Process: 4627 ExecStop=/etc/init.d/openerp-server stop (code=exited, status=0/SUCCESS)
Process: 3908 ExecStart=/etc/init.d/openerp-server start (code=exited, status=0/SUCCESS)
Oct 12 18:58:18 tkl-odoo systemd[1]: Starting LSB: Open Enterprise Resource Management software...
Oct 12 18:58:18 tkl-odoo openerp-server[3908]: Starting openerp-server: openerp-server.
Oct 12 18:58:18 tkl-odoo systemd[1]: Started LSB: Open Enterprise Resource Management software.
Oct 12 19:35:14 tkl-odoo systemd[1]: Stopping LSB: Open Enterprise Resource Management software...
Oct 12 19:35:14 tkl-odoo openerp-server[4627]: Stopping openerp-server: openerp-server.
Oct 12 19:35:14 tkl-odoo systemd[1]: Stopped LSB: Open Enterprise Resource Management software.
root@tkl-odoo ~# systemctl start openerp-server.service
root@tkl-odoo ~# systemctl status openerp-server.service
* openerp-server.service - LSB: Open Enterprise Resource Management software
Loaded: loaded (/etc/init.d/openerp-server)
Active: active (running) since Mon 2015-10-12 19:35:31 UTC; 1s ago
Process: 4627 ExecStop=/etc/init.d/openerp-server stop (code=exited, status=0/SUCCESS)
Process: 4661 ExecStart=/etc/init.d/openerp-server start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/openerp-server.service
|-4665 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-4680 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-4681 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-4682 /usr/bin/python /opt/openerp/odoo/openerp-gevent --config=/etc/odoo/openerp-server.conf
|-4683 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
`-4684 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
Oct 12 19:35:31 tkl-odoo openerp-server[4661]: Starting openerp-server: openerp-server.
Oct 12 19:35:31 tkl-odoo systemd[1]: Started LSB: Open Enterprise Resource Management software.
root@tkl-odoo ~# tail /var/run/odoo/openerp-server.pid
4665
root@tkl-odoo ~# systemctl status openerp-server.service
* openerp-server.service - LSB: Open Enterprise Resource Management software
Loaded: loaded (/etc/init.d/openerp-server)
Active: active (running) since Mon 2015-10-12 19:35:31 UTC; 4min 5s ago
Process: 4627 ExecStop=/etc/init.d/openerp-server stop (code=exited, status=0/SUCCESS)
Process: 4661 ExecStart=/etc/init.d/openerp-server start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/openerp-server.service
|-4665 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-4680 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-4681 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-4682 /usr/bin/python /opt/openerp/odoo/openerp-gevent --config=/etc/odoo/openerp-server.conf
|-4683 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
`-4684 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
Oct 12 19:35:31 tkl-odoo openerp-server[4661]: Starting openerp-server: openerp-server.
Oct 12 19:35:31 tkl-odoo systemd[1]: Started LSB: Open Enterprise Resource Management software.
root@tkl-odoo ~# ls -l /var/run/odoo/
total 4
-rw-r--r-- 1 openerp openerp 4 Oct 12 19:35 openerp-server.pid
root@tkl-odoo ~# systemctl stop openerp-server.service
root@tkl-odoo ~# ls -l /var/run/odoo/
total 0
root@tkl-odoo ~# systemctl status openerp-server.service
* openerp-server.service - LSB: Open Enterprise Resource Management software
Loaded: loaded (/etc/init.d/openerp-server)
Active: inactive (dead) since Mon 2015-10-12 19:46:27 UTC; 1min 8s ago
Process: 4859 ExecStop=/etc/init.d/openerp-server stop (code=exited, status=0/SUCCESS)
Process: 4661 ExecStart=/etc/init.d/openerp-server start (code=exited, status=0/SUCCESS)
Oct 12 19:35:31 tkl-odoo openerp-server[4661]: Starting openerp-server: openerp-server.
Oct 12 19:35:31 tkl-odoo systemd[1]: Started LSB: Open Enterprise Resource Management software.
Oct 12 19:46:27 tkl-odoo systemd[1]: Stopping LSB: Open Enterprise Resource Management software...
Oct 12 19:46:27 tkl-odoo openerp-server[4859]: Stopping openerp-server: openerp-server.
Oct 12 19:46:27 tkl-odoo systemd[1]: Stopped LSB: Open Enterprise Resource Management software.
root@tkl-odoo ~# service openerp-server start
root@tkl-odoo ~# tail /var/run/odoo/openerp-server.pid
4957
root@tkl-odoo ~# systemctl status openerp-server.service
* openerp-server.service - LSB: Open Enterprise Resource Management software
Loaded: loaded (/etc/init.d/openerp-server)
Active: active (running) since Mon 2015-10-12 19:47:52 UTC; 12s ago
Process: 4859 ExecStop=/etc/init.d/openerp-server stop (code=exited, status=0/SUCCESS)
Process: 4953 ExecStart=/etc/init.d/openerp-server start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/openerp-server.service
|-4957 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-4972 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-4973 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
|-4974 /usr/bin/python /opt/openerp/odoo/openerp-gevent --config=/etc/odoo/openerp-server.conf
|-4975 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
`-4976 python /opt/openerp/odoo/openerp-server --config=/etc/odoo/openerp-server.conf
Oct 12 19:47:52 tkl-odoo openerp-server[4953]: Starting openerp-server: openerp-server.
Oct 12 19:47:52 tkl-odoo systemd[1]: Started LSB: Open Enterprise Resource Management software.
As referenced https://github.com/DocCyblade/tkl-odoo/issues/41#issuecomment-146382058
Maybe look at moving this and let Odoo manage it?