my $whoami = `whoami` or die $!;
chomp($whoami) or die;
+ $c{Username} ||= $whoami;
my $nodename = `uname -n` or die $!;
chomp($nodename) or die;
$c{TftpPath} ||= "/tftpboot/";
$c{TftpPxeDir} ||= "pxelinux.cfg/";
$c{TftpPxeTemplates} ||= '%ipaddrhex% 01-%etherhyph%';
- $c{TftpPlayDir} ||= "$whoami/osstest/";
+ $c{TftpPlayDir} ||= "$c{Username}/osstest/";
$c{TftpTmpDir} ||= "$c{TftpPlayDir}tmp/";
$c{TftpDiBase} ||= "$c{TftpPlayDir}debian-installer";
$c{TftpGrubVersion} ||= 'current';
$c{WebspaceFile} ||= "$ENV{'HOME'}/public_html/";
- $c{WebspaceUrl} ||= "http://$myfqdn/~$whoami/";
+ $c{WebspaceUrl} ||= "http://$myfqdn/~$c{Username}/";
$c{WebspaceCommon} ||= 'osstest/';
$c{WebspaceLog} ||= '/var/log/apache2/access.log';
return opendb('statedb');
}
-our $whoami;
-
sub db_pg_dsn ($) {
my ($dbname) = @_;
my $pg= $c{"ExecutiveDbname_$dbname"};
if (!defined $pg) {
- if (!defined $whoami) {
- $whoami = `whoami`; die if $?; chomp $whoami;
- }
my $pat= $c{ExecutiveDbnamePat};
my %vars= ('dbname' => $dbname,
- 'whoami' => $whoami);
+ 'whoami' => $c{Username});
$pat =~ s#\<(\w+)\>#
my $val=$vars{$1}; defined $val or die "$pat $1 ?";
$val;
my $q;
my $what;
if (!defined $spec) {
- $!=0; $?=0; my $whoami= `whoami`; defined $whoami or die "$? $!";
$!=0; $?=0; my $node= `uname -n`; defined $node or die "$? $!";
- chomp($whoami); chomp($node); $node =~ s/\..*//;
- my $refkey= "$whoami\@$node";
+ chomp($node); $node =~ s/\..*//;
+ my $refkey= "$c{Username}\@$node";
$what= "static $refkey";
$q= $dbh_tests->prepare(<<END);
SELECT * FROM tasks
}
sub manual_allocation_base_jobinfo () {
- my $whoami = `whoami`; chomp $whoami;
my $hostname = `uname -n`; chomp $hostname;
- my $info = "$whoami\@$hostname";
+ my $info = "$c{Username}\@$hostname";
my $tty = `tty 2>/dev/null`; chomp $tty;
$info .= " ($tty)" unless $?;
return $info;
Timezone
Olson TZ name, used by host and guest installers
+Username
+ User name on this host. Defaults to the output of `whoami'.
+ Should not normally be changed.
+
========================================
Host-specific config settigs
esac
expect="#@@ "
-expect+="`whoami`"
+expect+="`whoami`" # not $c{Username}
expect+="@"
expect+="`hostname -f`"
if [ x"$flight" = x ]; then badusage; fi
: ${blessing:=play}
-: ${email:=`whoami`}
+: ${email:=`getconfig Username`}
set +e
tty=`exec 2>/dev/null; tty`
"
}
-username=`whoami`
+username=`getconfig Username`
nodename=`uname -n`
suffix=_$username
invocation_now=`date +%s`
moretasks error \
"WHERE type = 'static'
AND refkey = :'refkey'" \
- -v refkey="$(whoami)@$(uname -n)"
+ -v refkey="${username}@$(uname -n)"
fi
tasks_cond=${tasks// / OR T=}