Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Answers to Frequently Asked Questions Tips and Tutorials My "Bread and Butter" Process Keep Alive Perl Script.... Post 60062 by Neo on Saturday 8th of January 2005 04:17:38 AM
Old 01-08-2005
My "Bread and Butter" Process Keep Alive Perl Script....

For the newbies, I should have posted this years ago....

Here is the standard (tiny) "bread and butter" perl script (on Linux) I use in my crontab files to insure key processes are alive ( just in case ! ) like httpd, named, sshd, etc.

The example below if for named......

Code:
#!/usr/bin/perl

open(PS,"/bin/ps x|") || die "Can't Open PS";
while(<PS>) {
if (/usr\/sbin\/named/) { close PS; exit;}
}
close PS;
system("/usr/sbin/named");

One of my biggest "server fears" is that named will die for some strange reason, so I feel safe knowing that named is always running with the script above.

New Linux/UNIX users might find it useful.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pid still alive after "control C"

hi , i'm running 2 similar script (ksh) under AIX , the first go normally out when i type "control c" : ps before : notes01 19882 38990 0 11:54:48 pts/0 0:00 recover -s cla0bkpe -d /base/base01 -t May 05 23:02:17 2005 -v -f -a /base/base01/mail/mail-01/xxxx.nsf notes01 30866 40880 0... (4 Replies)
Discussion started by: Nicol
4 Replies

2. Shell Programming and Scripting

How to include RETURN KEY with Background process "&" in Shell Script

Hello All, I am a newbie in Shell script programming, and maybe you can help me with my query. I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script. The mntServer.ksh script contains: #!/bin/ksh... (1 Reply)
Discussion started by: racbern
1 Replies

3. Shell Programming and Scripting

Startup Script "run process with Timer"

Hi I have a script that execute every X minute for checking new files in a folder and converting to pdf. Is there any way to start this script automatically on linux startup?. I use sleep function in script with infinite loop. while do killall -u `whoami` -q soffice soffice... (0 Replies)
Discussion started by: zawmn83
0 Replies

4. Shell Programming and Scripting

Shell script process remains after "exit 1"

I have a script that performs an oracle export: <snip> if then exp / full=y file=${exp_file} log=${exp_log} direct=y feedback=1000000 STATISTICS=NONE buffer=20000000 else exp / full=n owner=${schema_name} file=${exp_file} log=${exp_log} direct=y feedback=1000000... (4 Replies)
Discussion started by: Squeakygoose
4 Replies

5. Red Hat

"service" , "process" and " daemon" ?

Friends , Anybody plz tell me what is the basic difference between "service" , "process" and " daemon" ? Waiting for kind reply .. .. (1 Reply)
Discussion started by: shipon_97
1 Replies

6. Shell Programming and Scripting

Ksh script function, how to "EXIT 2" without killing the current process?

Hi, Using AIX 5.3 and Ksh. />ls -al /usr/bin/ksh -r-xr-xr-x 5 bin bin 237420 Apr 10 2007 /usr/bin/ksh /> I recently started working for a new employer. I have written UNIX K-Shell scripts for many years and have never had this particular issue before. Its perplexing me. I have... (2 Replies)
Discussion started by: troym72
2 Replies

7. Shell Programming and Scripting

Send "perl -e '...' " command through SSH, from a perl script

Hey guys I am trying to send a perl -e command to a number of systems using SSH. The command should retrieve some information for me. The problem is, the remote shell tries to interpolate my variables and doesn't get it should take the command literally and just execute it. Below the code.... (2 Replies)
Discussion started by: clrg
2 Replies

8. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
Color::Library::Dictionary::Tango(3pm)			User Contributed Perl Documentation		    Color::Library::Dictionary::Tango(3pm)

NAME
Color::Library::Dictionary::Tango - (Tango) The Tango color palette DESCRIPTION
The Tango icon theme's goal is to make applications not seem alien on any desktop. A user running a multiplatform application should not have the impression that the look is unpolished and inconsistent with what he or she is used to. While this isn't about merging styles of all desktop systems, we do aim to not be drastically different on each platform. The Tango color palette consists of 27 RGB colors. <http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines> COLORS
Aluminium 1 aluminium1 #eeeeec Aluminium 2 aluminium2 #d3d7cf Aluminium 3 aluminium3 #babdb6 Aluminium 4 aluminium4 #888a85 Aluminium 5 aluminium5 #555753 Aluminium 6 aluminium6 #2e3436 Butter 1 butter1 #fce94f Butter 2 butter2 #edd400 Butter 3 butter3 #c4a000 Chameleon 1 chameleon1 #8ae234 Chameleon 2 chameleon2 #73d216 Chameleon 3 chameleon3 #4e9a06 Chocolate 1 chocolate1 #e9b96e Chocolate 2 chocolate2 #c17d11 Chocolate 3 chocolate3 #8f5902 Orange 1 orange1 #fcaf3e Orange 2 orange2 #f57900 Orange 3 orange3 #ce5c00 Plum 1 plum1 #ad7fa8 Plum 2 plum2 #75507b Plum 3 plum3 #5c3566 Scarlet Red 1 scarletred1 #ef2929 Scarlet Red 2 scarletred2 #cc0000 Scarlet Red 3 scarletred3 #a40000 Sky Blue 1 skyblue1 #729fcf Sky Blue 2 skyblue2 #3465a4 Sky Blue 3 skyblue3 #204a87 perl v5.14.2 2011-12-07 Color::Library::Dictionary::Tango(3pm)
All times are GMT -4. The time now is 03:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy