Operating System - HP-UX
1849586 Members
6837 Online
104044 Solutions
New Discussion

No utmp entry. You must exec "login" from the lowest level "sh".

 
Justin Willoughby
Regular Advisor

No utmp entry. You must exec "login" from the lowest level "sh".

I have the a problem on two terminals connected directly to my hpux box.

I read in another thread that the first field (id) in /etc/inittab should be four characters. The lines for the two terminals that are having some problems are only two characters.

a0:3:respawn:/usr/sbin/getty -h tty1p3 H
a1:3:respawn:/usr/sbin/getty -h tty1p4 H

After gettting the 'No utmp entry. You must exec "login" from the lowest level "sh"' the second login always works.

Looking at the man page for inittab seems to indicate that the id for each entry in inittab should be four characters long to avoid problems. I am guessing because mine are only two, they are corrupting my /etc/utmp file?

Would this be an accurate guess?

Another person posted to the same thread that to fix this problem /etc/utmp should be reset by `cp /dev/null /etc/utmp` and if that does not work do the same for /etc/utmpx
Is this ok to do while the system is running and users are logged in? Will it cause any problems?

I created/setup a terminal with SAM and it only created an entry in /etc/inittab with a two character id. If you should use a four character id why is SAM only using two?

Thanks,

- Justin
2 REPLIES 2
Jitendra_1
Trusted Contributor

Re: No utmp entry. You must exec "login" from the lowest level "sh".

You are right. This situation refers to utmp file corruption .
You can recreate /etc/utmp and /etc/utmpx by cp /dev/null /etc/utmp . However I dont know if doing it on a running system will affect presently logged in users. never done it. You may want to copy the existing files to saved location before trying it out.
Also two character ids in /etc/inittab is normal.

hope this helps.
Learning is the Key!
Jeff Barber
Occasional Advisor

Re: No utmp entry. You must exec "login" from the lowest level "sh".

This has happened to me a couple of times before, the only side-effect I've noticed of removing utmp is that after you've done it "who" will lead you to believe that there is no-one logged onto the machine. who sources utmp to see who is currently on the system - empty utmp=no-one (apparently) logged in.