Init script incorrectly handles stop and/or multiple starts

Bug #414864 reported by José González Gómez
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
openerp-server (Ubuntu)
Fix Released
Medium
Daniel Hahler
Hardy
Won't Fix
Undecided
Unassigned
Lucid
Won't Fix
Undecided
Unassigned
Maverick
Won't Fix
Undecided
Unassigned
Natty
Won't Fix
Undecided
Unassigned
Oneiric
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: openerp-server

1. Ubuntu version
Ubuntu version
Description: Ubuntu 8.04.3 LTS
Release: 8.04

2. Package version
openerp-server-5.0.0-3-1ubuntu2

3. What you expected to happen
The init script should be able to launch only a openerp-server process and to stop it

4. What happened instead
The init script failed to stop the openerp-server if you previously call it with the start option more than once

The init script for openerp-server uses a combination of --pidfile and --exec options. Once started the openerp-server process no longer is called /usr/bin/openerp-server, as you may see running ps:

openerp 31572 1 55 16:59 ? 00:00:01 /usr/bin/python ./openerp-server.py --config=/etc/openerp-server.conf

If you run again the init script with the start option, start-stop-daemon is unable to find the openerp process (the combination of pid and process name doesn't exist) and tries to launch it again. This causes the pid file to be overwritten, and a new openerp process to be launched that eventually fails and stop due to address already in use.

If you then try to stop the openerp-server the init script is unable to do it, because the original pid file no longer exists.

This can be easily avoided changing the --exec parameter for --startas, so start-stop-daemon only checks for pid, and not process name.

Revision history for this message
Daniel Hahler (blueyed) wrote :

This appears to be fixed, given version 5.0.15-2 (Ubuntu Oneiric):

% ps aux|grep openerp
openerp 16045 3.8 0.2 54572 17460 ? Sl 20:34 0:00 /usr/bin/python ./openerp-server.py --config=/etc/openerp-server.conf
% sudo invoke-rc.d openerp-server start
Starting openerp-server: openerp-server.
% ps aux|grep openerp
openerp 16045 2.3 0.2 54572 17460 ? Sl 20:34 0:00 /usr/bin/python ./openerp-server.py --config=/etc/openerp-server.conf

Changed in openerp-server (Ubuntu):
importance: Undecided → Medium
status: New → Fix Released
Revision history for this message
Daniel Hahler (blueyed) wrote :

I'm sorry to have misread your report. Please ignore my previous comment - the pidfile gets "corrupted" indeed, and "stop" will fail.

Changed in openerp-server (Ubuntu):
status: Fix Released → Triaged
Daniel Hahler (blueyed)
Changed in openerp-server (Ubuntu):
assignee: nobody → Daniel Hahler (blueyed)
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openerp-server - 5.0.15-2ubuntu1

---------------
openerp-server (5.0.15-2ubuntu1) precise; urgency=low

  * Fix creation of openerp user, when a user openerp* already exists.
    - debian/openerp-server.postinst
    - LP: #807017
  * Fix multiple starts of the server, by using "startas" and "oknodo" with
    start-stop-daemon.
    - debian/openerp-server.init
    - LP: #414864
    - This should also fix "userdel: user openerp is currently logged in"
      (LP: #454436).
 -- Daniel Hahler <email address hidden> Sat, 22 Oct 2011 21:03:11 +0200

Changed in openerp-server (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Daniel Hahler (blueyed) wrote :

Here is the used patch for reference (relevant to a StableReleaseUpdate):
http://launchpadlibrarian.net/83458989/openerp-server_5.0.15-2_5.0.15-2ubuntu1.diff.gz

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Maverick has long since stopped to receive any updates. Marking the Maverick task for this ticket as "Won't Fix".

Changed in openerp-server (Ubuntu Maverick):
status: New → Won't Fix
Revision history for this message
Rolf Leggewie (r0lf) wrote :

Hardy has seen the end of its life and is no longer receiving any updates. Marking the Hardy task for this ticket as "Won't Fix".

Changed in openerp-server (Ubuntu Hardy):
status: New → Won't Fix
Revision history for this message
Rolf Leggewie (r0lf) wrote :

natty has seen the end of its life and is no longer receiving any updates. Marking the natty task for this ticket as "Won't Fix".

Changed in openerp-server (Ubuntu Natty):
status: New → Won't Fix
Revision history for this message
Rolf Leggewie (r0lf) wrote :

oneiric has seen the end of its life and is no longer receiving any updates. Marking the oneiric task for this ticket as "Won't Fix".

Changed in openerp-server (Ubuntu Oneiric):
status: New → Won't Fix
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in openerp-server (Ubuntu Lucid):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.