summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdkonline.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/mdkonline.pm b/mdkonline.pm
index 1f73ecab..845fd256 100644
--- a/mdkonline.pm
+++ b/mdkonline.pm
@@ -211,6 +211,8 @@ LASTCHECK=$d
sub is_running {
my ($name) = @_;
+ # Set USER environment variable if necessary:
+ $ENV{USER} ||= getlogin || (getpwuid($<))[0];
any {
my ($ppid, $pid, $n) = /^\s*(\d+)\s+(\d+)\s+(.*)/;
#- to run ps, perl may create some process with $name as name and 1 as ppid