[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mon
Subject:    Re: respawning mon on Linux
From:       Zbigniew Kuzera <makak07 () mat ! uni ! torun ! pl>
Date:       2007-09-21 14:15:19
Message-ID: Pine.GSO.4.58.0709211615040.10314 () ultra60
[Download RAW message or body]


The problem with mon and INIT is the following:

- assuming we are in runlevel 3.
- I start mon by "/etc/init.d/mon start". Then "/usr/sbin/mon" process is
started.
- the I switch to runlevel 5
- when INIT discover that runlevel 5 is reached then reads from
/etc/inittab:

Amon:5:respawn:/usr/sbin/mon -c /etc/mon/mon.cf
(or sth similar: "startproc /usr/sbin/mon ...")

that it should start "/usr/sbin/mon -c /etc/mon/mon.cf", but such process
is already running!
INIT does not know it (for some reason) and tries to run its own instance
of mon process.
This fails 10 times since it is not possible to run more than 1 instance
of mon process that listens on 28583 port.
That's why INIT complains every 5 minutes:

INIT: Id "Amon" respawning too fast: disabled for 5 minutes

I changed the way mon is started:
- I turned off mon service by "chkconfig mon off"
- add "/usr/sbin/mon -l -c /etc/mon/mon.cf </dev/null > /dev/console 2>&1"
to /etc/inittab
- then just switched to runlevel 5 and mon is started automatically

Now when I kill mon process INIT automatially respawn it.

I believe this is the best solution im my situation...
Thanks for all suggestions!

On Thu, 20 Sep 2007, Jim Trocki wrote:

> On Thu, 20 Sep 2007, Zbigniew Kuzera wrote:
>
> > Hi,
> >
> > I am using mon utility on SuSE 9.3.
> >
> > I would like you to ask if you know some way to make mon process
> > "unkillable".
> >
> > I start mon by /etc/init.d/mon start.
> > My goal is to make mon respawnable.
> >
> > I tried to add the following entry to /etc/initab:
> > Amon:5:respawn:/usr/sbin/mon -c /etc/mon/mon.cf </dev/null >/dev/console
> > 2>&1
> > but then "init" complained about:
> > ipgw0202 mon[28583]: fatal, could not bind TCP server port 2583: Address
> > already in use
>
> when i add this to /etc/inittab on my SLES10 box, it fires up mon just
> fine, and restarts it when i kill it:
>
> mon:3:respawn:/usr/sbin/mon -l -c /etc/mon/mon.cf
>

_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic