supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* check script
@ 2007-03-12 14:44 Jorge Almeida
  2007-03-13 10:44 ` Gerrit Pape
  0 siblings, 1 reply; 3+ messages in thread
From: Jorge Almeida @ 2007-03-12 14:44 UTC (permalink / raw)
  To: supervision

I ran socklog-conf and it created a file /etc/sv/socklog-unix/check that
looks like a run script:
 	#!/bin/sh
 	exec 2>/dev/null
 	exec socklog-check unix /dev/log
Reading the man page for socklog-check, I would expect the run script
for the socklog-unix service to be like
 	#!/bin/sh
 	exec 2>&1
 	socklog-check || exit 1
 	exec chpst -Usyslogger socklog unix /dev/log
Instead, it is
 	#!/bin/sh
 	exec 2>&1
 	exec chpst -Usyslogger socklog unix /dev/log
and the check script is just aside the run script.

Can someone explain what is the purpose of /etc/sv/socklog-unix/check?

-- 
Jorge Almeida


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: check script
  2007-03-12 14:44 check script Jorge Almeida
@ 2007-03-13 10:44 ` Gerrit Pape
  2007-03-13 14:38   ` Jorge Almeida
  0 siblings, 1 reply; 3+ messages in thread
From: Gerrit Pape @ 2007-03-13 10:44 UTC (permalink / raw)
  To: supervision

On Mon, Mar 12, 2007 at 02:44:40PM +0000, Jorge Almeida wrote:
> I ran socklog-conf and it created a file /etc/sv/socklog-unix/check that
> looks like a run script:
> 	#!/bin/sh
> 	exec 2>/dev/null
> 	exec socklog-check unix /dev/log

> Can someone explain what is the purpose of /etc/sv/socklog-unix/check?

See http://smarden.org/runit/sv.8.html

It's run by 'sv start|restart|force-restart|check' and 'sv -v up'
to check whether the service is up and functional, and not only the
service daemon started.  Here it checks whether a program is listening
on /dev/log.

The ./check script is optional, and good for service dependencies.  For
services that run service daemons that use syslog() to write log
messages, 'sv start socklog-unix || exit' should be added to the run
script, to make sure that no log messages are lost on bootup because the
service daemon calls syslog() before the socklog-unix service actually
is listening on /dev/log.

HTH, Gerrit.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: check script
  2007-03-13 10:44 ` Gerrit Pape
@ 2007-03-13 14:38   ` Jorge Almeida
  0 siblings, 0 replies; 3+ messages in thread
From: Jorge Almeida @ 2007-03-13 14:38 UTC (permalink / raw)
  To: Gerrit Pape; +Cc: supervision

On Tue, 13 Mar 2007, Gerrit Pape wrote:

>
> See http://smarden.org/runit/sv.8.html
I knew it had to be somewhere!
BTW, the main page http://smarden.org/runit/ doesn't have a link to
the program socklog-check. Is there a reason for this, or was it just an
overlook?
>
> It's run by 'sv start|restart|force-restart|check' and 'sv -v up'
> to check whether the service is up and functional, and not only the
> service daemon started.  Here it checks whether a program is listening
> on /dev/log.
>
> The ./check script is optional, and good for service dependencies.  For
> services that run service daemons that use syslog() to write log
> messages, 'sv start socklog-unix || exit' should be added to the run
> script, to make sure that no log messages are lost on bootup because the
> service daemon calls syslog() before the socklog-unix service actually
> is listening on /dev/log.
>
> HTH, Gerrit.
>
Thanks,

Jorge


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-03-13 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-12 14:44 check script Jorge Almeida
2007-03-13 10:44 ` Gerrit Pape
2007-03-13 14:38   ` Jorge Almeida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).