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

Bug#203239: debian-policy: Add 'restart-if-running' option to initscripts

Package: debian-policy
Version: 3.6.0
Severity: wishlist

Wish #87994 originally submitted by Henrique M Holschuh <hmh@debian.org>
seems to have been closed inadvertently.  It was merged with #60979
which was closed by release

>   * When asked to restart a service that isn't already running,
>     the init script should start it,              closes: #60979

Wish #87994, however, was for the countenancing of an initscript option
that restarts services only if they _are_ running.  That would be useful
to have in postinst scripts on upgrade.

--- Original #87994 ---

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
      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.

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux thanatos 2.4.21 #3 Wed Jun 18 21:35:52 CEST 2003 i686
Locale: LANG=en_IE@euro, LC_CTYPE=en_IE@euro

-- no debconf information

Reply to: