Re: unversal watchdog

2006-03-02 Thread Brian Reichert
On Wed, Mar 01, 2006 at 10:20:03PM -0700, M. Warner Losh wrote:
 : You can do it with /etc/ttys. Actually this point is missing by many
 : FreeBSD administrators, people just think of /etc/ttys in term of
 : terminals and stuff :) But if youi'll open the man page you would
 : found the following:

It may have already been volunteered already; has the OP explored
daemontools?

I'll note that its master 'svscan' script is launched by an rc.d
script (a decision of the port maintainer), not init directly, but
that's not a hard change to affect...

 Warner

-- 
Brian Reichert  [EMAIL PROTECTED]
55 Crystal Ave. #286Daytime number: (603) 434-6842
Derry NH 03038-1725 USA BSD admin/developer at large
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unversal watchdog

2006-03-01 Thread M. Warner Losh
In message: [EMAIL PROTECTED]
Alex Semenyaka [EMAIL PROTECTED] writes:
: On Mon, Feb 27, 2006 at 05:41:32PM +0700, Vitaliy Ovsyannikov wrote:
:  Hello, freebsd-hackers.
:I've stuck with the unable to make watchdogs for daemons running via
:  startup rc-scripts. In linux we can just put the process in the
:  inittab. Does FreeBSD contains ability like this?
: 
: You can do it with /etc/ttys. Actually this point is missing by many
: FreeBSD administrators, people just think of /etc/ttys in term of
: terminals and stuff :) But if youi'll open the man page you would
: found the following:
: 
:  The first field is normally the name of the terminal special file as it
:  is found in /dev.  However, it can be any arbitrary string when the asso-
:  ciated command is not related to a tty.
: 
: So you can perfectly run any program there and init will watch or it, just
: like in linux.

The behavior goes back to at least 4.2 BSD (not FreeBSD 4.2, but 4.2
BSD).  I've used it on old SunOS 3.x boxes too...

Warner
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unversal watchdog

2006-02-28 Thread Kostik Belousov
On Tue, Feb 28, 2006 at 07:26:26AM +0300, Alex Semenyaka wrote:
 On Mon, Feb 27, 2006 at 05:41:32PM +0700, Vitaliy Ovsyannikov wrote:
  Hello, freebsd-hackers.
I've stuck with the unable to make watchdogs for daemons running via
  startup rc-scripts. In linux we can just put the process in the
  inittab. Does FreeBSD contains ability like this?
 
 You can do it with /etc/ttys. Actually this point is missing by many
 FreeBSD administrators, people just think of /etc/ttys in term of
 terminals and stuff :) But if youi'll open the man page you would
 found the following:
 
  The first field is normally the name of the terminal special file as it
  is found in /dev.  However, it can be any arbitrary string when the asso-
  ciated command is not related to a tty.
 
 So you can perfectly run any program there and init will watch or it, just
 like in linux.
 
 -- 
 Sincerely,
 Alex Semenyaka

But, just to be aware, see PR bin/64198.

Best regards,
Kostik Belousov


pgpXwbb1rHQcO.pgp
Description: PGP signature


Re: unversal watchdog

2006-02-27 Thread Daniel O'Connor
On Monday 27 February 2006 21:11, Vitaliy Ovsyannikov wrote:
   I've stuck with the unable to make watchdogs for daemons running via
 startup rc-scripts. In linux we can just put the process in the
 inittab. Does FreeBSD contains ability like this?

Create a script for /etc/rc.d (or /usr/local/etc/rc.d) - with a suitable entry 
in rc.conf it will be started at boot.

man rc.subr plus a look through /etc/rc.d should get you started :)

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


pgpgP5aYu5S1x.pgp
Description: PGP signature


Re: unversal watchdog

2006-02-27 Thread Tobias Roth
On Mon, Feb 27, 2006 at 09:53:17PM +1030, Daniel O'Connor wrote:
 On Monday 27 February 2006 21:11, Vitaliy Ovsyannikov wrote:
I've stuck with the unable to make watchdogs for daemons running via
  startup rc-scripts. In linux we can just put the process in the
  inittab. Does FreeBSD contains ability like this?
 
 Create a script for /etc/rc.d (or /usr/local/etc/rc.d) - with a suitable 
 entry 
 in rc.conf it will be started at boot.
 
 man rc.subr plus a look through /etc/rc.d should get you started :)

Can you explain in more detail how one can handle the watchdog part of
the equation? I can't find that information in the rc.subr manpage.

thanks, Tobias
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unversal watchdog

2006-02-27 Thread Daniel O'Connor
On Monday 27 February 2006 22:33, Tobias Roth wrote:
  man rc.subr plus a look through /etc/rc.d should get you started :)

 Can you explain in more detail how one can handle the watchdog part of
 the equation? I can't find that information in the rc.subr manpage.

Ahh sorry I think I misunderstood the question :(

I was thinking a program to reset a hardware watchdog timer..

As to answer the question - I am not aware of any facility for automatically 
restarting things (unless you can get init to do it via /etc/ttys somehow)

I don't think it would be too hard to create a shell wrapper script though 
(kind of annoying I admit)

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


pgplb4lPVzUkp.pgp
Description: PGP signature


Re: Re: unversal watchdog

2006-02-27 Thread Sergey Babkin
From: Daniel O'Connor [EMAIL PROTECTED]

On Monday 27 February 2006 22:33, Tobias Roth wrote:
  man rc.subr plus a look through /etc/rc.d should get you started :)

 Can you explain in more detail how one can handle the watchdog part of
 the equation? I can't find that information in the rc.subr manpage.

Ahh sorry I think I misunderstood the question :(

I was thinking a program to reset a hardware watchdog timer..

As to answer the question - I am not aware of any facility for automatically 
restarting things (unless you can get init to do it via /etc/ttys somehow)

Would a port of a Linux init do ? :-) You know, it's
all separate packages on Linux and there is no reason
why they can't be ported and used separately. Here is
the package name from RedHat:

$ rpm -qf /sbin/init
SysVinit-2.85-4.2

I don't know if there is a ready port but it should
be not THAT difficult to do.

I don't think it would be too hard to create a shell wrapper script though 
(kind of annoying I admit)

Well, it's been a long story now. Every time someone comes
with the idea of adding init to BSD, other people feel very
strongly that they hate init and that it must not be in BSD.

-SB
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unversal watchdog

2006-02-27 Thread Joseph Koshy
dc As to answer the question - I am not aware of any facility for
dc automatically restarting things (unless you can get init to do
dc it via /etc/ttys somehow)

Wasn't there a port of launchd in the wings?

--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unversal watchdog

2006-02-27 Thread Deomid Ryabkov

Vitaliy Ovsyannikov wrote:

Hello, freebsd-hackers.

  I've stuck with the unable to make watchdogs for daemons running via
startup rc-scripts. In linux we can just put the process in the
inittab. Does FreeBSD contains ability like this?

  

try sysutils/daemontools

--
Deomid Ryabkov aka Rojer
[EMAIL PROTECTED]
[EMAIL PROTECTED]
ICQ: 8025844



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Re: unversal watchdog

2006-02-27 Thread joerg
On Mon, Feb 27, 2006 at 07:20:45AM -0600, Sergey Babkin wrote:
 Well, it's been a long story now. Every time someone comes
 with the idea of adding init to BSD, other people feel very
 strongly that they hate init and that it must not be in BSD.

/sbin/init existed on BSD almost forever. You could fake a tty to use it
for restarting the programs. But the real issue is what restart
functionality the OP really wants. There's more than one way to do it
and whether the SysV init approach is appropiate depends. E.g. what
happens if some part of the configuration is rejected and the daemon
just spins?

Joerg
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unversal watchdog

2006-02-27 Thread John-Mark Gurney
Vitaliy Ovsyannikov wrote this message on Mon, Feb 27, 2006 at 17:41 +0700:
   I've stuck with the unable to make watchdogs for daemons running via
 startup rc-scripts. In linux we can just put the process in the
 inittab. Does FreeBSD contains ability like this?

yes, you can use ttys(5) for this...  You will get an extra argument
or two... but a wrapper script can handle that for you...  Though you
need to have the daemon run in foreground mode, so that when it dies
init knows it did, and restarts it...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 All that I will do, has been done, All that I have, has not.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unversal watchdog

2006-02-27 Thread M. Warner Losh
In message: [EMAIL PROTECTED]
Daniel O'Connor [EMAIL PROTECTED] writes:
: As to answer the question - I am not aware of any facility for automatically 
: restarting things (unless you can get init to do it via /etc/ttys somehow)
: 
: I don't think it would be too hard to create a shell wrapper script though 
: (kind of annoying I admit)

Actually, putting it in /etc/ttys with a fake device name is the
canonical way to get this functionality.  We do it all the time at
work and it works out well.

Warner
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unversal watchdog

2006-02-27 Thread Alex Semenyaka
On Mon, Feb 27, 2006 at 05:41:32PM +0700, Vitaliy Ovsyannikov wrote:
 Hello, freebsd-hackers.
   I've stuck with the unable to make watchdogs for daemons running via
 startup rc-scripts. In linux we can just put the process in the
 inittab. Does FreeBSD contains ability like this?

You can do it with /etc/ttys. Actually this point is missing by many
FreeBSD administrators, people just think of /etc/ttys in term of
terminals and stuff :) But if youi'll open the man page you would
found the following:

 The first field is normally the name of the terminal special file as it
 is found in /dev.  However, it can be any arbitrary string when the asso-
 ciated command is not related to a tty.

So you can perfectly run any program there and init will watch or it, just
like in linux.

-- 
Sincerely,
Alex Semenyaka
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]