Problem
In single user (maintenance) mode I type "logname" and instead of the system returning the login name, it returns:
logname: could not find entry in /etc/utmp Cause
The functionality of "logname" is behaving properly. The command "logname" is available only in multiuser mode.
The "login" process registers the login name with /etc/utmp; however, login is not run when single-user (maintenance) mode is entered so no login name is registered.
Solution
If the "logname" command is to be used, the system must be booted to multiuser mode.
An alternate method of finding the login name is to run:
id -lunwhich will not depend on utmp.Or, alternatively:id -l | sed 's/.*luid=[0-9]*(//;s/).*//' See also
TA105022 "logname(C) fails with the error message 'could not find entry in /etc/utmp'."