[Bug 1031035] Re: Transmission daemon upstart support

Dmitrijs Ledkovs launchpad at surgut.co.uk
Tue Aug 21 19:41:23 UTC 2012


Here is an example snippet:

http://upstart.ubuntu.com/cookbook/#pre-start-example-ubuntu-specific
"""
pre-start script

  # stop job from continuing if no config file found for daemon
  [ ! -f /etc/default/myapp ] && { stop; exit 0; }

  # source the config file
  . /etc/default/myapp

  # stop job from continuing if admin has not enabled service in
  # config file.
  [ -z "$ENABLED" ] && { stop; exit 0; }

end script
"""

You will need to source the config file again to get the customized
options.

If you implement the pre-start correctly, I'd be happy to sponsor this
into Ubuntu.

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1031035

Title:
  Transmission daemon upstart support

Status in “transmission” package in Ubuntu:
  Confirmed

Bug description:
  I have attached an upstart script to run transmission-daemon with upstart instead of sysvinit.
  This has two advantages:

  1.
  Upstart supports graceful shutdown timeouts. This means upstart will
  wait for transmission to exit properly for an amount of time before
  killing it (in this script 30 seconds) which is useful if transmission
  needs to transmit a lot of status data to trackers on exiting.

  2.
  Upstart supports automatic respawning when transmission-daemon crashes /
  exits with a non-clean exit code. This happened to me quite regularly
  every couple of weeks and it's a helpful feature. With the default
  setting upstart will try to restart transmission up to 10 times with 5
  second intervals between the tries.

  For deployment, just copy the
  file into the debian directory and debhelper will take care of proper
  installation, no additional work needed. On debian were there is no
  upstart debhelper will just install the plain old init file, so no
  trouble there either.
  I tested the script on precise, it works very well for me but I'm sure additional testing will not hurt.

  Please feel free to publish this under any license / copyright /
  author / whatever you see fit. Hope this can be useful.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/1031035/+subscriptions



More information about the Ubuntu-sponsors mailing list