Technical article 104588

Rebuild ttys file from inittab including pseudo ttys after crash.

OpenServer 6.0.0OpenServer 5.0.7

Written · Last revised

Problem

The /etc/auth/system/ttys file is corrupted.  How can this file be
rebuilt to include inittab terminals and pseudo ttys?
The following error messages from
/usr/adm/syslog

are an indication that the file may be corrupted and/or when I try to login I get pauses during login and messages indicating "can't securely create ttys database".

Can't rewrite terminal control entry Cannot obtain database information on this terminal can't find terminal control database entry for line ttyp33 can't find tty entries in the tty database

Solution

Take the following steps (these MAY be performed in multiuser mode):

cd /etc/auth/system
mv ttys /tmp/ttys.bad

Please note that if you just copy it, you will need to manually remove ttys.

touch /etc/auth/system/ttys
chown auth:auth /etc/auth/system/ttys
/tcb/bin/ttyupd
/tcb/bin/ale /etc/auth/system/ttys pttyupd

pttyupd is a shell script located in /tcb/lib/auth_scripts. It must be run with the above syntax because pttyupd will fail to run if called directly.

NOTE:     If the script fails to run with an error that it could not securely
          update the file then it is suggested to look for and remove the
          ttys-t file.  For example, on OpenServer6:
/var/opt/K/SCO/Unix/6.0.0Ni/etc/auth/system/ttys-t
This was located with:
find /etc /tcb /var -name *-t
NOTES:    If you see the following error during boot:
Mounted /dev/_tcp filesystem
$1/etc/smmck: /etc/auth/system/ttys is missing or zero length.
either enter single user mode and restore it from a backup or
let the system rebuild a skeleton version from /etc/inittab
during multiuser mode startup.

If the server than hangs and doesn't progress then it is recommended to reboot and enter Single User Mode to attempt the ttys file to be recreated.

If you see the following error during boot into Single-User mode:

Mounted /dev/_tcp filesystem
/etc/tcbck: file /var/opt/K/SCO/Unix/6.0.0Ni/etc/auth/system/ttys
missing.  saved $fn-t as $fn
mv: unable to move ttys-t to ttys. No such device or address
(error 6)

and in attempting to create the ttys file manually using the steps above I get:

touch: cannot create ttys: No such device or address (error 6)

The inode file point would appear to be corrupted and potentially might be fixed with a:

# fsck -ofull /dev/rroot

See also

ta105610, "I want to clear my system of users who are not logged in," for scripted version of the above.

ta103157, "System hangs 'Type CONTROL-d' or 'Current System Time' prompts."

From the Xinuos technical article database, record 104588. Reproduced with permission. The original is at www.sco.com/ta/104588, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.