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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
From d532647546d36ac5bc269d3437a01a50054370fc Mon Sep 17 00:00:00 2001
From: Robin H. Johnson <robbat2@gentoo.org>
Date: Sat, 12 May 2007 23:36:07 -0700
Subject: [PATCH mogilefs] 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>
---
server/mogautomount | 3 +++
server/mogdbsetup | 3 +++
server/mogilefsd | 3 +++
server/mogstored | 3 +++
4 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/server/mogautomount b/server/mogautomount
index 68ca723..f3cefe6 100755
--- a/server/mogautomount
+++ b/server/mogautomount
@@ -3,6 +3,9 @@
use strict;
use Getopt::Long;
+# Rename binary in process list to make init scripts saner
+$0 = $_ = $0;
+
my ($help, $verbose);
usage(0) unless GetOptions(
'help' => \$help,
diff --git a/server/mogdbsetup b/server/mogdbsetup
index 155dbf9..ecf29ad 100755
--- a/server/mogdbsetup
+++ b/server/mogdbsetup
@@ -4,6 +4,9 @@ use Getopt::Long;
use lib 'lib';
use MogileFS::Store;
+# Rename binary in process list to make init scripts saner
+$0 = $_ = $0;
+
my %args = (
dbhost => "localhost",
dbname => "mogilefs",
diff --git a/server/mogilefsd b/server/mogilefsd
index b8224f3..2b64c32 100755
--- a/server/mogilefsd
+++ b/server/mogilefsd
@@ -12,6 +12,9 @@ use warnings;
use lib 'lib';
use MogileFS::Server;
+# Rename binary in process list to make init scripts saner
+$0 = $_ = $0;
+
my $s = MogileFS::Server->server;
$s->run;
diff --git a/server/mogstored b/server/mogstored
index ccb26c4..1c7ed4a 100755
--- a/server/mogstored
+++ b/server/mogstored
@@ -47,6 +47,9 @@ my $default_config = "/etc/mogilefs/mogstored.conf";
my $server = $ENV{MOGSTORED_SERVER_TYPE} || "perlbal";
my $serverbin = "";
+# Rename binary in process list to make init scripts saner
+$0 = $_ = $0;
+
my %config_opts = (
'iostat' => \$opt_iostat,
'daemonize|d' => \$opt_daemonize,
--
1.5.1.4
|