numam-spdk/scripts
Daniel Verkamp 56306a468f scripts/setup.sh: add logname fallback
In some circumstances, no utmp entry is available, so logname fails.

In particular, gnome-terminal no longer creates a utmp entry:
https://bugzilla.gnome.org/show_bug.cgi?id=747046

As a workaround, try $SUDO_USER - the use case here is to determine
the (unprivileged) user name so we can give them ownership of
certain files, so this is usually the right thing to use anyway.

If we are not running under sudo, the caller should have passed the
username as a parameter to scripts/setup.sh anyway, since we can't
reliably determine which user is intended.

Also check if username is actually set before using it to run chmod - it
is possible that the scripts/setup.sh caller does not want to provide
access to an unprivilieged user and just wants to run everything as
root.

Change-Id: I20631c325b52884a378029dcf38568a2b311b457
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 10:51:49 -07:00
..
autotest_common.sh test: move RBD test pool setup to autotest.sh 2016-11-17 12:46:37 -07:00
build_kmod.sh spdk: add the ioat_kperf test tool to autobuild system 2016-01-22 07:58:13 -07:00
check_format.sh check_format: check Python style with pep8 2016-10-18 13:35:19 -07:00
eofnl eofnl: check for DOS-style newlines 2016-11-29 11:15:18 -07:00
fio.py iscsi: Add an iscsi target application 2016-08-04 13:15:33 -07:00
genconfig.py genconfig: undef bool options so #ifdef works 2016-06-24 10:42:18 -07:00
rpc.py scrips/rpc.py: add vhost scsi RPC commands 2016-11-23 12:42:10 -07:00
setup.sh scripts/setup.sh: add logname fallback 2016-11-30 10:51:49 -07:00