@@ -78,13 +78,11 @@ Note: The process that runs this command must be either root or the user specifi
78
78
sub start {
79
79
my $self = shift ;
80
80
my $wreConfig = $self -> wreConfig;
81
- $wreConfig -> set(" wreMonitor/nginxAdministrativelyDown" , 0);
82
81
my $host = WRE::Host-> new(wreConfig => $wreConfig );
83
82
unless ($wreConfig -> get(" nginx/port" ) > 1024 || $host -> isPrivilegedUser) {
84
83
croak " You are not an administrator on this machine so you cannot start services with ports 1-1024." ;
85
84
}
86
- my $cmd = " " ;
87
- $cmd = $wreConfig -> getRoot(" /prereqs/bin/nginx" )." -c " .$wreConfig -> getRoot(" /etc/nginx.conf" );
85
+ my $cmd = $wreConfig -> getRoot(" /prereqs/bin/nginx" )." -c " .$wreConfig -> getRoot(" /etc/nginx.conf" );
88
86
my $count = 0;
89
87
my $success = 0;
90
88
` $cmd ` ; # catch command line output
@@ -93,6 +91,9 @@ sub start {
93
91
eval {$success = $self -> ping};
94
92
$count ++;
95
93
}
94
+ if ($success ) {
95
+ $wreConfig -> set(" wreMonitor/nginxAdministrativelyDown" , 0);
96
+ }
96
97
return $success ;
97
98
}
98
99
@@ -109,7 +110,6 @@ Note: The process that runs this command must be either root or the user specifi
109
110
sub stop {
110
111
my $self = shift ;
111
112
my $wreConfig = $self -> wreConfig;
112
- $wreConfig -> set(" wreMonitor/modproxyAdministrativelyDown" , 1);
113
113
my $host = WRE::Host-> new(wreConfig => $wreConfig );
114
114
unless ($wreConfig -> get(" nginx/port" ) > 1024 || $host -> isPrivilegedUser) {
115
115
croak " You are not an administrator on this machine so you cannot stop services with ports 1-1024." ;
@@ -122,6 +122,9 @@ sub stop {
122
122
$success = !(eval {$self -> ping});
123
123
$count ++;
124
124
}
125
+ if ($success ) {
126
+ $wreConfig -> set(" wreMonitor/modproxyAdministrativelyDown" , 1);
127
+ }
125
128
return $success ;
126
129
}
127
130
0 commit comments