Operating System - HP-UX
1821216 Members
3126 Online
109632 Solutions
New Discussion юеВ

Problem with Single User Mode

 
SOLVED
Go to solution
Davor Bira?
Frequent Advisor

Problem with Single User Mode

Hi,

I have problem with Single User Mode. Every time I switch to SUM, my prompt freezes and display this message:
logname: could not get login name
I have also notice the same situation, when I try to execute .profile (in / directory) in SUM.
Can somebody help?
9 REPLIES 9
Navin Bhat_2
Trusted Contributor
Solution

Re: Problem with Single User Mode

Can you post your .profile please?

thx
G. Vrijhoeven
Honored Contributor

Re: Problem with Single User Mode

Hi,

I addition to above.
What is your login shell for root. (/sbin/sh)
/usr is not mounted in SUM.

Regards,

Gideon
Navin Bhat_2
Trusted Contributor

Re: Problem with Single User Mode

Also please mention the version of HP-UX you are using.
Abdul Rahiman
Esteemed Contributor

Re: Problem with Single User Mode

logname command looks up the following files to look up the user info.
/etc/utmp
/var/adm/wtmp
/var/adm/btmp
logname could give an error if any of these files are either corrupt or unavailable.
No unix, no fun
Bharat Katkar
Honored Contributor

Re: Problem with Single User Mode

May be your profile is not setting correctly PS1 / PS2.
Also look out for the TERM variable.

Regards,
You need to know a lot to actually know how little you know
Navin Bhat_2
Trusted Contributor

Re: Problem with Single User Mode

If it is 11.0 check if you have Patch PHCO_19701 installed.
For other OS look at the Equiv section in the patch description of PHCO_19701

[PHCO_18424/PACHRDME/English] :
1. tsm(1) fails with "permission denied" message
while opening ttys. This is due to an incorrect
verification method used for the master-slave
tty pair. The previous fix used "/dev/ptym/clone"
instead of master pty and the corresponding changes
were not made in the verfication process.

2. logname(1) fails with "could not get login name"
message on tsm sessions. This is due to incorrect
utmp entries being written to the /etc/utmp file
by tsm(1).

Resolution :
1. During the verification process, check whether
the clone device is used instead of the master
pty.
2. Write only the base name of the tty to the
/etc/utmp file.
Davor Bira?
Frequent Advisor

Re: Problem with Single User Mode

Thanks for your quick answers.
.profile is in attach.
It is HP-UX 11.11
root shell is /sbin/sh.
To me thease files: /etc/utmp, /var/adm/wtmp/ and /var/adm/btmp look just fine. I have edited them with fwtmp, and it shows no errors.
PHCO_19701 doesn't have equivalent for HP-UX 11.11
G. Vrijhoeven
Honored Contributor

Re: Problem with Single User Mode

Hi,

I think this is the problem.

if grep -q $(logname) /etc/user_su
then
echo "You cannot direct logint. Please, use su!!!"
exit
fi

Regards,

Gideon
Abdul Rahiman
Esteemed Contributor

Re: Problem with Single User Mode

Davor,
I think your problem is logname command erroring out either due to missing some info. on /etc/utmp on SUM or you might be missing a patch.
When you fwtmp the /etc/utmp in SUM, do you see the your terminal name you are logged on?
I am sure it would be correct on multi-user mode, but not sure how it looks like in SUM though.
No unix, no fun