Bug 184502

Summary: tinyerp-server.pid was not deleted in the event of service crashes.
Product: [Fedora] Fedora Reporter: Francesco Pelullo <francesco.pelullo>
Component: tinyerpAssignee: Dan Horák <dan>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: medium    
Version: 4CC: extras-qa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 3.2.1-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-18 14:40:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Francesco Pelullo 2006-03-09 11:45:10 UTC
Description of problem:
The file
/var/spool/tinyerp/tinyerp-server.pid 
is not deleted in the event of service "tinyerp-server" crashes because of
invalid configuration.

Version-Release number of selected component (if applicable):
3.2.1-1.fc4

How reproducible:
It's sufficient to run tinyerp-server by the command line by a parameter that
was wrong.

Steps to Reproduce:
1. # service tinyerp-server stop
2. # tinyerp-server --i18n-import=the_translation_file_name.csv -l Language_Code
3. # service tinyerp-server start
  
Actual results:


Expected results:


Additional info:
I'll open another bug for tinyerp-server because the /etc/tinyerp-server.conf
contains variables that are incongruent with online documentation.

Comment 1 Dan Horák 2006-03-10 09:35:53 UTC
The thing with pidfile a bit complicated. tinyerp-server is written to be run
from the command line on the foreground. The support for pidfile and the ability
to be controlled as a Fedora/Redhat service is a small hack. Running it directly
as root is causing problems mainly with ownership of files (pid and log) created
during the run. The secure way of running the server is running the server
python code directly with "python
/usr/lib/python2.4/site-packages/tinyerp-server/tinyerp-server.py" and not using
the /usr/bin/tinyerp-server wrapper script.

The short-term solution can be deleting the pidfile before starting the service. 
Also the init.d script will restore ownership of the logfile to the tinyerp
user. The long-term solution will be to include support for creating a pidfile
into tinyerp-server itself. I will move these issues (both pidfile and logfile)
to the upstream developers.

Comment 2 Dan Horák 2006-03-10 11:19:14 UTC
I have just created a patch for the server which adds the possibility to
automagicly create/destroy the pidfile and also adds the possibility to redirect
the log output from stdout to a file. I will update the package during the next
weekend, now I am going to the Dolomites for skiing ;-)