Gentoo Archives: gentoo-user

From: Jarry <jarry@×××.net>
To: gentoo-user@l.g.o
Subject: [gentoo-user] automatic restart of crushed processes...
Date: Tue, 26 Jul 2005 10:05:23
Message-Id: 42E609A5.5040705@gmx.net
Greetings to all Gentoo-users!

Is it somehow possible to check, whether a certain process is running,
and if not, then start it? I would like to use it for some processes
that crush sometimes (like teamspeak and some game-servers), and to
mointor sshd, because it is critical for me (my server will be 300km
away from me).

I thought about writing some small shell-script, which would be run
by cron at regular intervals, check if a process is running (something
like "ps -e | grep $PROCNAME", or maybe with "pidof -s $PROCNAME")
and if not, than it would start that process with its script in
/etc/init.d.

But if there is already something which would do the same, I don't
want to work on inventing the wheel again. Moreover, my shell scripts
are rather "quick'n'dirty", so maybe I should start with reading
"Advanced Bash-Scripting Guide"...

Jarry

-- 
gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] automatic restart of crushed processes... Neil Bothwick <neil@××××××××××.uk>
Re: [gentoo-user] automatic restart of crushed processes... "Mariusz Pękala" <skoot@××.pl>
Re: [gentoo-user] automatic restart of crushed processes... Bastian Balthazar Bux <BastianBalthazarBux@×××××××××.it>