summaryrefslogtreecommitdiff
path: root/dev-perl/Gearman-Server/files/Gearman-Server-1.130.1-Use-saner-name-in-process-listing.patch
blob: c46ac0ecef59f7b55c77e454c90abc013ffb338c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From acd6722c16e17ddbdf6c73c99c693b7674f0fea7 Mon Sep 17 00:00:00 2001
From: "Robin H. Johnson" <robbat2@gentoo.org>
Date: Sat, 12 May 2007 22:16:37 -0700
Subject: Use saner name in process listing.

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>
---
 bin/gearmand | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/gearmand b/bin/gearmand
index 6046a99..68d1bcf 100755
--- a/bin/gearmand
+++ b/bin/gearmand
@@ -130,6 +130,9 @@ my ($daemonize, $nokeepalive, $notify_pid, $opt_pidfile, $accept, $wakeup,
     $wakeup_delay, $conf_host,);
 my $conf_port = 4730;
 
+# Rename binary in process list to make init scripts saner
+$0 = $_ = $0;
+
 Getopt::Long::GetOptions(
     'd|daemonize'    => \$daemonize,
     'p|port=i'       => \$conf_port,
-- 
2.14.2