Perlbal - [PATCH perlbal] Use saner name in process listing.

This is Interesting: Free IT Magazines  
Home > Archive > Perlbal > May 2007 > [PATCH perlbal] Use saner name in process listing.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [PATCH perlbal] Use saner name in process listing.
Robin H. Johnson

2007-05-13, 7:11 am

Normally the binary will turn up in the process list as:
/usr/bin/perl $SCRIPTNAME

By adding a single line, we can make it be simply '$SCRIPTNAME'.
This makes writing init.d scripts signficently easier.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
---
perlbal | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/perlbal b/perlbal
index f0149b3..7a9d28c 100755
--- a/perlbal
+++ b/perlbal
@@ -37,6 +37,10 @@ my $opt_daemonize;
my $opt_config;
my $opt_help;
my $opt_version;
+
+# Rename binary in process list to make init scripts saner
+$0 = $_ = $0;
+
usage(1) unless
Getopt::Long::GetOptions(
'daemon' => \$opt_daemonize,
--
1.5.1.4


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com