start_daemon should supply --chdir $PWD to start-to-stop-daemon

Bug #234098 reported by Michael Blakeley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lsb (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Karmic by Michael Blakeley

Bug Description

Binary package hint: lsb

http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html says that "Each conforming init script shall execute the commands in the file /lib/lsb/init-functions in the current environment...." I read this to include the current working directory. However, start-stop-daemon changes the current directory to root, unless --chdir is supplied. Therefore, I believe that start_daemon should supply --chdir $PWD to start-to-stop-daemon.

Not doing so causes problems with some rpm-based packages, that cd to a specific directory before starting. I've attached a patch that seems to work.

$ lsb_release -rd
Description: Ubuntu 8.04
Release: 8.04
$ apt-show-versions lsb-base
lsb-base/hardy uptodate 3.2-4ubuntu1

Revision history for this message
Michael Blakeley (mike+ubuntu) wrote :
Revision history for this message
Michael Blakeley (mike+ubuntu) wrote :

The lsb-base package documents support for LSB 3.2, not 3.1. So I'll add that http://refspecs.freestandards.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html also specifies the "current environment".

Revision history for this message
Michael Blakeley (mike+ubuntu) wrote :

This is still a problem with intrepid alpha 4. The patch is somewhat simpler, since init-functions no longer uses 'eval' to start daemons (upstream debian change, I suppose?). But the existing patch is still relevant.

Revision history for this message
Michael Blakeley (mike+ubuntu) wrote :

This has been fixed upstream in debian sid, as lsb-base_3.2-22. If there's still time, it would be nice to have the change in jaunty (currently 3.2-20ubuntu4).

Revision history for this message
Michael Blakeley (mike+ubuntu) wrote :

lsb-base/karmic uptodate 4.0-0ubuntu2 fixes this issue.

Changed in lsb (Ubuntu):
status: New → Fix Committed
Przemek K. (azrael)
Changed in lsb (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

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