startup script is broken

Bug #42632 reported by JustusWinter
36
Affects Status Importance Assigned to Milestone
mldonkey (Ubuntu)
Fix Released
Medium
MOTU Reviewers Team

Bug Description

the startup script from mldonkey-server version 2.7.1-2ubuntu2 contains the line

install -o mldonkey -g mldoney -m 755 -f $PIDFILE

but according to my sources, there is no -f switch for install.

<rant>
was this script run _once_ before submitting the package? :P
</rant>

Revision history for this message
JustusWinter (4winter) wrote : quick fix

I replaced install with touch, chown and chmod :)

Revision history for this message
Bertrand Croq (bcroq) wrote :

2 things:
- mldoney is not the good name (missing a "k")
- -f is not a supported parameter for "install"

Here is a replacement that works for me:

install -o mldonkey -g mldonkey -m 755 -d $(dirname $PIDFILE)

Revision history for this message
Jim Bailey (jim-freesolutions) wrote :

I can confirm it works for me too

Revision history for this message
Hervé Fache (rvfh) wrote :

Can someone pleaaaase fix this package? It's been broken for a while now. If the fix above works, then can the maintainer please implement, test and release _before_ Dapper is out?

Thanks guys.

Goldenear (goldenear)
Changed in mldonkey:
status: Unconfirmed → Confirmed
Revision history for this message
Daniel Holbach (dholbach) wrote :

The problem with the patch is that in debconf you can specify as which user and which group this runs. This is not considered in the patch. (while I agree that it should work in most cases, it breaks other cases).

Changed in mldonkey:
assignee: nobody → motureviewers
Revision history for this message
danisan (correo-de-danisan) wrote : quick fix 2

Change in /etc/init.d/mldonkey-server

install -o mldonkey -g mldoney -m 755 -f $PIDFILE

with

install -o mldonkey -g mldonkey -m 755 -d $(dirname $PIDFILE)

Seen in http://72.14.221.104/search?q=cache:keVv0CQ2fF0J:www.ecualug.org/%3Fq%3Daggregator/sources/7%26from%3D20+%22install+-o+mldonkey+-g+mldonkey%22+&hl=es&gl=es&ct=clnk&cd=1&client=firefox

Revision history for this message
Joshua Ochs (diamondsw) wrote :

"The problem with the patch is that in debconf you can specify as which user and which group this runs."

The problem with the existing code is it DOES NOT RUN. Please try to explain why this is a preferable state of affairs to the simple patch posted. Put the patch as in and let it work for 99% of people, and revisit this later for the remaining 1%.

Meanwhile, this is an obvious bug that would have been found if the script had been run ONCE prior to submitting the package. I'm at a loss for acceptable language to express my disgust.

Revision history for this message
Bertrand Croq (bcroq) wrote :

Here is a fix for the fix :

install -o ${MLDONKEY_USER:-mldonkey} -g "${MLDONKEY_GROUP:-mldonkey}" -m 755 -d $(dirname $PIDFILE)

This might need to add the MLDONKEY_USER declaration in /etc/defaults/mldonkey-server, by adding a line in mldonkey-server.postinst where this file is generated:

MLDONKEY_USER=$run_as_user

But in fact, by trying to start/stop/reinstall this package I have found bugs in the /etc/init.d script :

- if mldonkey-server is configured at installation so that it doesn't start at boot time, the package cannot be reconfigured or desinstalled because the "stop" command doesn't work (it doesn't test if $PIDFILE exists before using it)

- if mldonkey-server is configured at installation so that it doesn't start at boot time, the "force-start" command doesn't work because the /etc/default/mldonkey-server file doesn't contain enough configuration... shouldn't the postinst script always do a full configuration ?

Revision history for this message
Jérémie Corbier (jcorbier) wrote :

New mldonkey version in edgy fixes this bug.

Changed in mldonkey:
status: Confirmed → Fix Committed
Revision history for this message
Jérémie Corbier (jcorbier) wrote :
Download full text (3.3 KiB)

mldonkey (2.7.7-5) unstable; urgency=low

  * Retry to stop the deamon with the --oknodo option of start-stop-daemon if
    stopping fails in order to work around an old bug in the init.d script,
    closes: #378934.
  * chown /var/run/mldonkey only if both variables MLDONKEY_USER and
    MLDONKEY_GROUP are set, closes: #378603.
  * Added arm_dynamic_loop_delay.dpatch on arm only to avoid a freeze of
    mldonkey, closes: #370107.

mldonkey (2.7.7-4) unstable; urgency=low

  * Import patch from Ubuntu (thanks Reinhard Tartler) to handle systems where
    /var/run is cleaned on reboot, closes: #354701.
    - Introduce new config variable in /etc/default/mldonkey-server:
      MLDONKEY_USER. This variable is only used by the init script.
    - Mke the initscript create /var/run/mldonkey-server, setting correct
      owner and permissions.
  * Added 04_cfs.dpatch (thanks spiralvoice) to handle CFS filesystems which
    incorrectly report freespace, closes: #377865.
  * Added a build-dependency on libmagic-dev, closes: #378150.
  * Added a build-dependency on ocaml-best-compilers since mldonkey is a
    fairly big package to build.
  * We don't need to remove rpaths anymore.

mldonkey (2.7.7-3) unstable; urgency=low

  * Added 03_lock_config_files_space.dpatch in order to handle leftover
    config_files_space.tmp files, closes: #359237.
  * Removed obsolete configure options, closes: #375921. Also removed Soulseek
    and Opennap from the description.
  * Updated french debconf templates translation, closes: #377574.
  * Depend on ocaml-base-nox instead of ocaml-base on non native archs.

mldonkey (2.7.7-2) unstable; urgency=low

  * mldonkey_options now correctly handles \" in strings, closes: #354433.
  * Disabling DirectConnect plugin for now since it is unstable and does not
    support uploading, closes: #224836.
  * Use ucf in postrm only if present, closes: #333314.

mldonkey (2.7.7-1) unstable; urgency=low

  * New maintainter:
    Debian OCaml Maintainers <email address hidden>.
  * New upstream release, closes: #361173.
  * Build-depend on ocaml-nox (>= 3.09.2), closes: #369770.
  * init.d script of mldonkey-server called with stop now exits with 0 even
    when the server was not running, closes: #338875.
  * Correcly set $HOME in mldonkey_server, closes: #355913.
  * Updated debconf templates and removed mldonkey-server/mldonkey_umask,
    mldonkey-server/client_name and mldonkey-server/plugin.
  * Removed unused debconf templates: mldonkey-server/config_exist_no_options,
    mldonkey-server/config_exist_no_dir and
    mldonkey-server/shared_directories, closes: #332320.
  * Updated the Czech debconf templates translation, closes: #335353.
  * Added a .desktop file for mldonkey-gui.
  * Updated standards version to 3.7.2, no changes needed.
  * Updated the watch file.

mldonkey (2.7.3-2) unstable; urgency=low

  * Fix the build on alpha by using a workaround when opt compilation
    has failed (Closes: #345793)

mldonkey (2.7.3-1) unstable; urgency=low

  * New upstream release
  * Test the presence of mlnet and mlgui, to fail ASAP if the compilation o...

Read more...

Changed in mldonkey:
status: Fix Committed → Fix Released
Revision history for this message
Uphaar Agrawalla (uphaar) wrote :

Can we get the fix in dapper-updates also? This bug has made mldonkey completely unusable on Dapper.

It would be great if that can be done.

Revision history for this message
KlfJoat (cliffbarbier) wrote : Re: fix in dapper-updates

I second the motion to put this in dapper-updates. This is the third package broken out of the box from Dapper, the supposedly stable, "long term" release. Please do the right thing and at least push this update out.

Revision history for this message
Jim Bailey (jim-freesolutions) wrote :

"I second the motion to put this in dapper-updates. This is the third package broken out of the box from Dapper, the supposedly stable, "long term" release. Please do the right thing and at least push this update out."

Mldonkey is not part of the "core" release and therefore doesn't have the testing that the supported packages have. It may not even be possible under current packages rules for Ubuntu if it isn't then the package should be held back to stop this spreading and giving Ubuntu a poorer reputation than it deserves.

A rating system for MOTU maintainers would be a good option for Ubuntu and even Debian maintainers for that matter. As would a voting system to remove the worse offenders or promote others more capable positions of authority within MOTU.

Changed in mldonkey (Ubuntu):
status: Fix Released → Fix Committed
Revision history for this message
Przemek K. (azrael) wrote :

Daniel Qian: please don't change the status of the bug without a valid reason.

Changed in mldonkey (Ubuntu):
status: Fix Committed → Fix Released
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.