[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#87994: [PROPOSAL] better initscript definition, and adding 'restart-if-running'



Package: debian-policy
Version: 3.5.2.0
Severity: wishlist

This proposal has ties to #76868 (invoke-rc.d), #60979 (what /etc/init.d/xxx
restart does?).

"Action" in the text below is the *first* parameter specified for an init
script (e.g.: in /etc/init.d/foo start, "start" is the action).

The naming for the new 'initscript action' was discussed in #76868, before
it was split from the main proposal of invoke-rc.d.

I propose that a new init script action, 'restart-if-running', defined as:
  IFF daemon-is-running-NOW then
      stop daemon
      start daemon
      return OK exit status if daemon started, otherwise return ERROR
  else
      return OK exit status

to be defined in policy, as *OPTIONAL*.

The main reason for such definition is that we currently lack the
functionality provided by 'restart-if-running', and it cannot be easily (as
in not in an error-prone way) emulated through other methods.

I'd also like us to better define init scripts, by making it forbidden to
have initscripts in Debian that:

  1. Act in a non-expected way for any of the actions defined in policy
     (e.g.: stopping a daemon in the 'start' action)
     
  2. Misbehaves if given an unknown action
     (e.g.: running the 'start' action regardless of what is passed to it as
      the first argument -- we have some stuff in rcS.d that has this problem,
      and yes, I am offering myself to hunt the offending parties down, fix
      them, send patches to the BTS, and NMU if the maintainer is too busy
      to apply the patch and upload).
     This should be read as: the initscript should return an non-zero status 
     code if called with an unknown/unsupported action.

-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux godzillah.rivendell.sol 2.2.19pre16 #1 Tue Feb 27 21:55:56 BRT 2001 i586

Versions of packages debian-policy depends on:
ii  fileutils                     4.0.37-1   GNU file management utilities.    

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh



Reply to: