summaryrefslogtreecommitdiffstats
path: root/mdkonline.pm
diff options
context:
space:
mode:
Diffstat (limited to 'mdkonline.pm')
-rw-r--r--mdkonline.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/mdkonline.pm b/mdkonline.pm
index b1394198..5cc9821c 100644
--- a/mdkonline.pm
+++ b/mdkonline.pm
@@ -224,6 +224,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