Paul Jarc | 14 Aug 2004 08:58
Picon

Re: Linux startup issue

Jonathan de Boyne Pollard <J.deBoynePollard <at> Tesco.NET> wrote:
> 2.  "Restart" is better implemented as "svc -t" rather than as "svc
> -du", since the latter has the side-effect of changing the current
> state (to "up") whereas the former does not.

More specifically:
- If the service is down to begin with, "svc -t" will have no effect;
  "svc -du" will bring the service up, with automatic restarting.
- If the service is running once from "svc -o", then "svc -t" will
  take it down and leave it down; "svc -du" will take it down and
  bring it back up, with automatic restarting; "svc -do" will take it
  down and bring it back up, without automatic restarting, just as it
  was originally.  (supervise publishes enough information in
  supervise/status to distinguish the "-o" state from the "-u" state,
  but svstat doesn't report it.)
- "svc -d" sends SIGTERM and SIGCONT, so if the service is stopped
  with SIGSTOP, it will be allowed to run again so it can exit.
  "svc -t" sends only SIGTERM, which is not sufficient to kill a
  stopped process, but it can be combined with "svc -c" for the same
  effect as "svc -d" (without turning off restarting).

paul

Stefan Karrmann | 14 Aug 2004 19:20
Picon

Re: Linux startup issue

Paul Jarc (Sat, Aug 14, 2004 at 02:58:26AM -0400):
> Jonathan de Boyne Pollard <J.deBoynePollard <at> Tesco.NET> wrote:
> > 2.  "Restart" is better implemented as "svc -t" rather than as "svc
> > -du", since the latter has the side-effect of changing the current
> > state (to "up") whereas the former does not.
> 
> More specifically:
> - If the service is down to begin with, "svc -t" will have no effect;
>   "svc -du" will bring the service up, with automatic restarting.
> - If the service is running once from "svc -o", then "svc -t" will
>   take it down and leave it down; "svc -du" will take it down and
>   bring it back up, with automatic restarting; "svc -do" will take it
>   down and bring it back up, without automatic restarting, just as it
>   was originally.  (supervise publishes enough information in
>   supervise/status to distinguish the "-o" state from the "-u" state,
>   but svstat doesn't report it.)
> - "svc -d" sends SIGTERM and SIGCONT, so if the service is stopped
>   with SIGSTOP, it will be allowed to run again so it can exit.
>   "svc -t" sends only SIGTERM, which is not sufficient to kill a
>   stopped process, but it can be combined with "svc -c" for the same
>   effect as "svc -d" (without turning off restarting).

My 2 cent:

- Use svc -tcu if the service is up.
- Use svc -tco if the service is running once.

--

-- 
Stefan

(Continue reading)


Gmane