telnet 접속시 No utmpx entry. You must exec "login" from the lowes
2010.05.12 03:31
원문 : http://www.ischo.net -- 조인상 // 시스템 엔지니어
Writer : http://www.ischo.net -- ischo // System Engineer in Replubic Of Korea
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
본문 : http://www.ischo.net -- 조인상 //시스템 엔지니어
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
No utmpx entry. You must exec "login" from the lowest level "shell".
On a headless system with the console directed to serial port a,
boot up messages are seen but no login prompt is displayed.
The output of the ps -ef|grep /dev/console command does not show the
/usr/lib/saf/ttymon process for the /dev/console device.
Executing that process manually per the last line in /etc/inittab does produce a
login prompt and the /dev/console process starts to run, but attempts to login to
the serial console return:
No utmpx entry.
The user must execute "login" from lowest level "shell" and the console login process dies.
Resolution Top
This problem is caused by changing the console login entry in
/etc/inittab from respawn to off.
To fix the problem, change the line back to respawn and execute the init q command to
reread inittab. The console process should start normally, the user can login, and that process
will respawn if killed.
If it is still not working, type:
# cat /dev/null > /var/adm/utmpx
# cat /dev/null > /var/adm/wtmpx
This will clean the utmpx and wtmpx, which will fix the problem
Note: The only recommended way to run the /dev/console process is from /etc/inittab.
Problem Statement: Top
When trying to telnet to a host, after typing in the username and password, you
receive the following error:
No utmpx entry. no utmpx entry you must exec "login" from the lowest level
"shell"
connection closed by foreign host.
Resolution: Top
This issue will only show up while using the telnet command. Other remote logins
like SSH or rlogin work fine.
First, clear /var/adm/utmpx and wtmpx:
# cat /dev/null > /var/adm/utmpx
# cat /dev/null > /var/adm/wtmpx
If this does not clear the issue, check the /etc/inittab for an entry that
starts with the letter t such as Tivoli Storage Manager which by default adds an
entry that starts with id of "tsm". Inittab reserves the letters t and r for
telnet and rlogin as per the man page.
From inittab(4) manpage:
id One to four characters used to uniquely identify an
entry. Do not use the characters "r" or "t" as the
first or only character in this field. These charac-
ters are reserved for the use of rlogin(1) and tel-
net(1).
To clear up this issue, edit the /etc/inittab file and change the offending id
tag.
It can be changed by adding a leading letter to it. For example, change "tsm" to
"xtsm". Or just change the offending letter to another letter. For example,
change "tsm" to "xsm". Next, run "init q" which forces the system to reexamine
/etc/inittab.
=====================================================================================
Document Audience: SPECTRUM
Document ID: 6000
Title: INIT: Cannot create /var/adm/utmp
Copyright Notice: Copyright ⓒ 2005 Sun Microsystems, Inc. All Rights Reserved
Update Date: Mon Aug 29 00:00:00 MDT 2005
Products: Solaris, Solaris 9 Operating System, Solaris 8 Operating System, Solaris 7 Operating System, Solaris 2.6 Operating System, Solaris 10 Operating System
Technical Areas: Install/Boot, Operating System
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Keyword(s):INIT, failed, write, utmpx, boot
Problem Statement Top
On bootup, the following error message appears:
INIT: Cannot create /var/adm/utmp or /var/adm/utmpx
INIT failed write of utmpx entry:" "
INIT: SINGLE USER MODE
Resolution Top
Possible causes and solutions
For troubleshooting, boot from CD-ROM (the same Solaris [TM] version that the system is running,
if possible) into single user mode, and mount the core Solaris filesystems under /a.
Example:
ok boot cdrom -sw
# /usr/sbin/fsck /dev/rdsk/c0t0d0s0
# mount /dev/dsk/c0t0d0s0 /a
If they are on separate disk slices, repeat the /usr/sbin/fsck and mount steps for the /usr, /var,
and /opt filesystems. Mount them to /a/usr, /a/var, and /a/opt, respectively. Example:
# /usr/sbin/fsck /dev/rdsk/c0t0d0s4
# mount /dev/dsk/c0t0d0s4 /a/var
1. If the core Solaris OE filesystems are mounted from physical disk slices, not
Veritas Volume Manager or Solstice DiskSuite volumes, then make sure the devices in
/a/etc/vfstab point to valid entries in /a/dev and that the entries in /a/dev are
symbolic links to valid devices in the /a/device directory, especially /var if it
is a separate slice.
Example: (cut from /a/etc/vfstab) /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no logging
# /usr/bin/ls -al /dev/dsk/c0t0d0s0
lrwxrwxrwx 1 root root 46 Aug 15 16:20 ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a
# /usr/bin/ls -al /a/dev/dsk/c0t0d0s0
lrwxrwxrwx 1 root root 46 Aug 15 16:20 ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a
If /usr/bin/ls -al output does not match, /usr/sbin/fsck and mounted the wrong device,
or your vfstab file may have bad entries in it. Verify the mounted filesystem is really
the root filesystem and fix the /etc/vfstab file if necessary.
2. Make sure the / and /var filesystems are not full. Example:
#/usr/sbin/df -k
Filesystem kilobytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 3277234 2837450 407012 88% /a
If /a or /a/var has 100% in the capacity column, clean out files on the full filesystem.
3. Make sure the startup scripts under /a/etc/rc[S,2,3].d and the files /a/sbin/rc[S,2,3]
are not corrupted. Run the scripts in shell debug mode by adding "set -x" in these scripts.
This will enable verbose output from the script as it runs, which may help pinpoint
the problem or its source.
Example:
#!/sbin/sh
set -x
4. Verify that there are not files in /a/etc with filenames in the format:
hostname.<network interface name><some number not relating to the interface instance>.
The startup script /etc/init.d/network will fail to parse these file names correctly.
See bugs 4943782 and 4865207.
Example of problem filename: /etc/hostname.hme0.9mar2005
5. Check the ownership and permissions of /a/var/adm/utmpx and /a/var/adm/wtmpx.
Since the files may be corrupted, clear their contents and again check permissions
and ownership. Do the following:
# /usr/bin/cp /dev/null /a/var/adm/utmpx
# /usr/bin/cp /dev/null /a/var/adm/wtmpx
# /usr/bin/chown root:bin /a/var/adm/utmpx
# /usr/bin/chmod 644 /a/var/adm/utmpx
# /usr/bin/chown adm:adm /a/var/adm/wtmpx
# /usr/bin/chmod 644 /a/var/adm/wtmpx
There should also be a /a/etc/utmpx and /a/etc/wtmpx that are symbolic links to
the files in ../var/adm/
Example:
# /usr/bin/ls -al /a/etc/?tmpx
lrwxrwxrwx 1 root root 16 Aug 15 2001 /etc/utmpx -> ../var/adm/utmpx
lrwxrwxrwx 1 root root 16 Aug 15 2001 /etc/wtmpx -> ../var/adm/wtmpx
# /usr/bin/ls -al /a/var/adm/?tmpx
-rw-r--r-- 1 root bin 11160 Apr 27 00:00 /var/adm/utmpx
-rw-r--r-- 1 adm adm 334056 Apr 25 17:53 /var/adm/wtmpx
6. Make sure the major number for the sysmsg device matches the major number used by
the device file in /devices. The minor numbers for the entry in the /devices entry
should follow the convention in the example, 0 for the sysmsg
device, and 1 for the msglog device. Example:
#grep sysmsg /a/etc/name_to_major
sysmsg 97
#/usr/bin/ls -al /a/devices/pseudo/sysmsg*
crw------- 1 root sys 97, 1 Jan 12 16:25 /devices/pseudo/sysmsg@0:msglog
crw------- 1 root sys 97, 0 Jan 30 16:38 /devices/pseudo/sysmsg@0:sysmsg
7. Check the /a/etc/inittab file for corruption by comparing to another system running
the same Solaris OE. The /etc/inittab file should not be used for comparison while booted
from CD-ROM, as its configuration is geared toward the installation process not system
recovery. If /etcd/inittab is corrupt, copy one the one from /cdrom/<insert Solaris OE
version here>/Product/SUNWcsr/reloc/etc to /a/etc.
8. Make sure /dev/console exists. It should be a symbolic link to
../devices/pseudo/cn@0:console The major and minor number of the device file
in /devices should be zero. The /etc/name_to_major file should also have a cn
device listed with major number zero.
Example:
# /usr/bin/ls -al /a/dev/console
lrwxrwxrwx 1 root other 30 Aug 15 2001 /dev/console -> ../devices/pseudo/cn@0:console
9. Check the /a/etc/rc[S,2,3].d directories. The files here should be hard linked
to files in /a/etc/init.d
Example:
#/usr/bin/ls -i /a/etc/rcS.d/S30rootusr.sh
327078 /etc/rcS.d/S30rootusr.sh
#/usr/bin/ls -i /a/etc/init.d/rootusr
327078 /etc/init.d/rootusr.sh
10. Make sure /a/sbin/sh is the statically linked form of the command.
Example:
# /usr/bin/file /a/sbin/sh
/a/sbin/sh: ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
#/usr/bin/file /bin/sh
/bin/sh: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
If /a/sbin/sh is not the statically linked version, copy the the one in /sbin to /a/sbin.
11. Corruption and/or incorrect entries in /a/etc/mnttab. Make a backup of /a/etc/mnttab
and cat /dev/null to the original.
12. Kernel corruption causing init to fail. This is a common one if the error started
after a patch installation (possibly in multi-user mode). Often, a restore from backup
is required, but the kernel patch can possibly be backed out:
Example:
# /usr/sbin/patchrm -R /a kernel_patch-revision
13. The /var partition did not mount on booting. If the /var directory is a symbolic link
to a filesystem that is not either / or /usr, then the above errors will appear on boot up.
Note: Making /var a separate partition (in /etc/vfstab) is okay. After making a backup
copy, edit /etc/init.d/standardmounts, modify the file so that the file system which
contains /var is mounted. The following is an example where /var resides in
/export/home/var:
exec < ${vfstab}; readvfstab "/export/home"
if [ "${mountp}" -a -d /export/home ]
then /sbin/mount -m /export/home > /dev/null 2>&1
mntlist="${mntlist}/export/home /export/home"
fi
14. Kernel corruption. You may be able to upgrade Solaris to the same version and hardware revision
to replace damaged binaries.
Note: Patch the system afterwards since all patches will be removed by this procedure.
15. Restore Solaris from a known good backup.
16. Reload a new copy of the Solaris Operating Environment.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
No utmpx entry. You must exec "login" from the lowest level "shell".
On a headless system with the console directed to serial port a,
boot up messages are seen but no login prompt is displayed.
The output of the ps -ef|grep /dev/console command does not show the
/usr/lib/saf/ttymon process for the /dev/console device.
Executing that process manually per the last line in /etc/inittab does produce a
login prompt and the /dev/console process starts to run, but attempts to login to
the serial console return:
No utmpx entry.
The user must execute "login" from lowest level "shell" and the console login process dies.
Resolution Top
This problem is caused by changing the console login entry in
/etc/inittab from respawn to off.
To fix the problem, change the line back to respawn and execute the init q command to
reread inittab. The console process should start normally, the user can login, and that process
will respawn if killed.
If it is still not working, type:
# cat /dev/null > /var/adm/utmpx
# cat /dev/null > /var/adm/wtmpx
This will clean the utmpx and wtmpx, which will fix the problem
Note: The only recommended way to run the /dev/console process is from /etc/inittab.
Problem Statement: Top
When trying to telnet to a host, after typing in the username and password, you
receive the following error:
No utmpx entry. no utmpx entry you must exec "login" from the lowest level
"shell"
connection closed by foreign host.
Resolution: Top
This issue will only show up while using the telnet command. Other remote logins
like SSH or rlogin work fine.
First, clear /var/adm/utmpx and wtmpx:
# cat /dev/null > /var/adm/utmpx
# cat /dev/null > /var/adm/wtmpx
If this does not clear the issue, check the /etc/inittab for an entry that
starts with the letter t such as Tivoli Storage Manager which by default adds an
entry that starts with id of "tsm". Inittab reserves the letters t and r for
telnet and rlogin as per the man page.
From inittab(4) manpage:
id One to four characters used to uniquely identify an
entry. Do not use the characters "r" or "t" as the
first or only character in this field. These charac-
ters are reserved for the use of rlogin(1) and tel-
net(1).
To clear up this issue, edit the /etc/inittab file and change the offending id
tag.
It can be changed by adding a leading letter to it. For example, change "tsm" to
"xtsm". Or just change the offending letter to another letter. For example,
change "tsm" to "xsm". Next, run "init q" which forces the system to reexamine
/etc/inittab.
=====================================================================================
Document Audience: SPECTRUM
Document ID: 6000
Title: INIT: Cannot create /var/adm/utmp
Copyright Notice: Copyright ⓒ 2005 Sun Microsystems, Inc. All Rights Reserved
Update Date: Mon Aug 29 00:00:00 MDT 2005
Products: Solaris, Solaris 9 Operating System, Solaris 8 Operating System, Solaris 7 Operating System, Solaris 2.6 Operating System, Solaris 10 Operating System
Technical Areas: Install/Boot, Operating System
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Keyword(s):INIT, failed, write, utmpx, boot
Problem Statement Top
On bootup, the following error message appears:
INIT: Cannot create /var/adm/utmp or /var/adm/utmpx
INIT failed write of utmpx entry:" "
INIT: SINGLE USER MODE
Resolution Top
Possible causes and solutions
For troubleshooting, boot from CD-ROM (the same Solaris [TM] version that the system is running,
if possible) into single user mode, and mount the core Solaris filesystems under /a.
Example:
ok boot cdrom -sw
# /usr/sbin/fsck /dev/rdsk/c0t0d0s0
# mount /dev/dsk/c0t0d0s0 /a
If they are on separate disk slices, repeat the /usr/sbin/fsck and mount steps for the /usr, /var,
and /opt filesystems. Mount them to /a/usr, /a/var, and /a/opt, respectively. Example:
# /usr/sbin/fsck /dev/rdsk/c0t0d0s4
# mount /dev/dsk/c0t0d0s4 /a/var
1. If the core Solaris OE filesystems are mounted from physical disk slices, not
Veritas Volume Manager or Solstice DiskSuite volumes, then make sure the devices in
/a/etc/vfstab point to valid entries in /a/dev and that the entries in /a/dev are
symbolic links to valid devices in the /a/device directory, especially /var if it
is a separate slice.
Example: (cut from /a/etc/vfstab) /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no logging
# /usr/bin/ls -al /dev/dsk/c0t0d0s0
lrwxrwxrwx 1 root root 46 Aug 15 16:20 ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a
# /usr/bin/ls -al /a/dev/dsk/c0t0d0s0
lrwxrwxrwx 1 root root 46 Aug 15 16:20 ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a
If /usr/bin/ls -al output does not match, /usr/sbin/fsck and mounted the wrong device,
or your vfstab file may have bad entries in it. Verify the mounted filesystem is really
the root filesystem and fix the /etc/vfstab file if necessary.
2. Make sure the / and /var filesystems are not full. Example:
#/usr/sbin/df -k
Filesystem kilobytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 3277234 2837450 407012 88% /a
If /a or /a/var has 100% in the capacity column, clean out files on the full filesystem.
3. Make sure the startup scripts under /a/etc/rc[S,2,3].d and the files /a/sbin/rc[S,2,3]
are not corrupted. Run the scripts in shell debug mode by adding "set -x" in these scripts.
This will enable verbose output from the script as it runs, which may help pinpoint
the problem or its source.
Example:
#!/sbin/sh
set -x
4. Verify that there are not files in /a/etc with filenames in the format:
hostname.<network interface name><some number not relating to the interface instance>.
The startup script /etc/init.d/network will fail to parse these file names correctly.
See bugs 4943782 and 4865207.
Example of problem filename: /etc/hostname.hme0.9mar2005
5. Check the ownership and permissions of /a/var/adm/utmpx and /a/var/adm/wtmpx.
Since the files may be corrupted, clear their contents and again check permissions
and ownership. Do the following:
# /usr/bin/cp /dev/null /a/var/adm/utmpx
# /usr/bin/cp /dev/null /a/var/adm/wtmpx
# /usr/bin/chown root:bin /a/var/adm/utmpx
# /usr/bin/chmod 644 /a/var/adm/utmpx
# /usr/bin/chown adm:adm /a/var/adm/wtmpx
# /usr/bin/chmod 644 /a/var/adm/wtmpx
There should also be a /a/etc/utmpx and /a/etc/wtmpx that are symbolic links to
the files in ../var/adm/
Example:
# /usr/bin/ls -al /a/etc/?tmpx
lrwxrwxrwx 1 root root 16 Aug 15 2001 /etc/utmpx -> ../var/adm/utmpx
lrwxrwxrwx 1 root root 16 Aug 15 2001 /etc/wtmpx -> ../var/adm/wtmpx
# /usr/bin/ls -al /a/var/adm/?tmpx
-rw-r--r-- 1 root bin 11160 Apr 27 00:00 /var/adm/utmpx
-rw-r--r-- 1 adm adm 334056 Apr 25 17:53 /var/adm/wtmpx
6. Make sure the major number for the sysmsg device matches the major number used by
the device file in /devices. The minor numbers for the entry in the /devices entry
should follow the convention in the example, 0 for the sysmsg
device, and 1 for the msglog device. Example:
#grep sysmsg /a/etc/name_to_major
sysmsg 97
#/usr/bin/ls -al /a/devices/pseudo/sysmsg*
crw------- 1 root sys 97, 1 Jan 12 16:25 /devices/pseudo/sysmsg@0:msglog
crw------- 1 root sys 97, 0 Jan 30 16:38 /devices/pseudo/sysmsg@0:sysmsg
7. Check the /a/etc/inittab file for corruption by comparing to another system running
the same Solaris OE. The /etc/inittab file should not be used for comparison while booted
from CD-ROM, as its configuration is geared toward the installation process not system
recovery. If /etcd/inittab is corrupt, copy one the one from /cdrom/<insert Solaris OE
version here>/Product/SUNWcsr/reloc/etc to /a/etc.
8. Make sure /dev/console exists. It should be a symbolic link to
../devices/pseudo/cn@0:console The major and minor number of the device file
in /devices should be zero. The /etc/name_to_major file should also have a cn
device listed with major number zero.
Example:
# /usr/bin/ls -al /a/dev/console
lrwxrwxrwx 1 root other 30 Aug 15 2001 /dev/console -> ../devices/pseudo/cn@0:console
9. Check the /a/etc/rc[S,2,3].d directories. The files here should be hard linked
to files in /a/etc/init.d
Example:
#/usr/bin/ls -i /a/etc/rcS.d/S30rootusr.sh
327078 /etc/rcS.d/S30rootusr.sh
#/usr/bin/ls -i /a/etc/init.d/rootusr
327078 /etc/init.d/rootusr.sh
10. Make sure /a/sbin/sh is the statically linked form of the command.
Example:
# /usr/bin/file /a/sbin/sh
/a/sbin/sh: ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
#/usr/bin/file /bin/sh
/bin/sh: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
If /a/sbin/sh is not the statically linked version, copy the the one in /sbin to /a/sbin.
11. Corruption and/or incorrect entries in /a/etc/mnttab. Make a backup of /a/etc/mnttab
and cat /dev/null to the original.
12. Kernel corruption causing init to fail. This is a common one if the error started
after a patch installation (possibly in multi-user mode). Often, a restore from backup
is required, but the kernel patch can possibly be backed out:
Example:
# /usr/sbin/patchrm -R /a kernel_patch-revision
13. The /var partition did not mount on booting. If the /var directory is a symbolic link
to a filesystem that is not either / or /usr, then the above errors will appear on boot up.
Note: Making /var a separate partition (in /etc/vfstab) is okay. After making a backup
copy, edit /etc/init.d/standardmounts, modify the file so that the file system which
contains /var is mounted. The following is an example where /var resides in
/export/home/var:
exec < ${vfstab}; readvfstab "/export/home"
if [ "${mountp}" -a -d /export/home ]
then /sbin/mount -m /export/home > /dev/null 2>&1
mntlist="${mntlist}/export/home /export/home"
fi
14. Kernel corruption. You may be able to upgrade Solaris to the same version and hardware revision
to replace damaged binaries.
Note: Patch the system afterwards since all patches will be removed by this procedure.
15. Restore Solaris from a known good backup.
16. Reload a new copy of the Solaris Operating Environment.