Gentoo Archives: gentoo-user

From: Bastian Balthazar Bux <BastianBalthazarBux@×××××××××.it>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] automatic restart of crushed processes...
Date: Tue, 26 Jul 2005 15:00:55
Message-Id: 42E64E98.5070106@pnpitalia.it
In Reply to: [gentoo-user] automatic restart of crushed processes... by Jarry
1 Jarry wrote:
2 > Greetings to all Gentoo-users!
3 >
4 > Is it somehow possible to check, whether a certain process is running,
5 > and if not, then start it? I would like to use it for some processes
6 > that crush sometimes (like teamspeak and some game-servers), and to
7 > mointor sshd, because it is critical for me (my server will be 300km
8 > away from me).
9 >
10 > I thought about writing some small shell-script, which would be run
11 > by cron at regular intervals, check if a process is running (something
12 > like "ps -e | grep $PROCNAME", or maybe with "pidof -s $PROCNAME")
13 > and if not, than it would start that process with its script in
14 > /etc/init.d.
15 >
16 > But if there is already something which would do the same, I don't
17 > want to work on inventing the wheel again. Moreover, my shell scripts
18 > are rather "quick'n'dirty", so maybe I should start with reading
19 > "Advanced Bash-Scripting Guide"...
20 >
21 > Jarry
22 >
23
24 emerge -pv sys-process/daemontools
25
26 These are the packages that I would merge, in order:
27
28 Calculating dependencies ...done!
29 [ebuild R ] sys-process/daemontools-0.76-r4 -doc (-selinux) -static
30 36 kB
31 --
32 gentoo-user@g.o mailing list