no run level

2 views
Skip to first unread message

Troyk

unread,
Jan 29, 2003, 1:47:13 PM1/29/03
to

Ran into a 5.0.4 SCO box with an odd problem. Whenever you try to
enable or disable a tty, eg, tty1A you get the message "enable: no run
level". Also doing a who -r comes up blank.

Don't know the history on this box but the users were telling me that
they could never get a printer to work slaved directly off the box, all
printers are setup through print servers.

The tty's work, ie, the modem and a digi etherlite that I installed on
it. Only way I could change the state of the ttys (enable or disable)
was to edit the inittab and do a kill -1 1.

Someone told me to check the utmp and wtmp files in /etc, but I don't
think it's those.

--
Posted via http://dbforums.com

Jean-Pierre Radley

unread,
Jan 30, 2003, 10:07:28 AM1/30/03
to ScoMisc [c.u.s.m]
Troyk typed (on Wed, Jan 29, 2003 at 01:47:13PM -0500):

It most assuredly *is* those files. Here's 'fixrunlevel':

#!/bin/sh
# John DuBois script to restore runlevel 2 into utmp
gawk '
BEGIN {
t = systime()
printf "\0\0\0\0\0\0\0\0\0\0\0\0run-level 2\0\0\0\1\0\0\0\0\0%c%c%c%c",t,t/256,t/65536,t/16777216
}' >> /etc/utmp

--
JP

Troyk

unread,
Jan 31, 2003, 12:06:19 PM1/31/03
to

That script didn't fix it, but I found this in /etc/rc.d/8/userdef

> /etc/utmp
> /etc/wtmp
> /etc/utmpx
> /etc/wtmpx

And a bunch of other stuff. I commented those lines out and now it's
working after a reboot.

Scott McMillan

unread,
Feb 1, 2003, 9:05:18 PM2/1/03
to
On Fri, 31 Jan 2003 12:06:19 -0500, Troyk <membe...@dbforums.com>
wrote:

>
>That script didn't fix it, but I found this in /etc/rc.d/8/userdef
>
>> /etc/utmp
>> /etc/wtmp
>> /etc/utmpx
>> /etc/wtmpx
>
>And a bunch of other stuff. I commented those lines out and now it's
>working after a reboot.

Wow, someone definitely misunderstood this write-up
http://stage.caldera.com/cgi-bin/ssl_reference?105610

which clearly states "The above script can be run manually prior to
shutting the system down". Your system was clearing these out as it
was coming back up.


Scott McMillan

Bela Lubkin

unread,
Feb 1, 2003, 11:59:48 PM2/1/03
to sco...@xenitec.on.ca
Scott McMillan wrote:

> >That script didn't fix it, but I found this in /etc/rc.d/8/userdef
> >
> >> /etc/utmp
> >> /etc/wtmp
> >> /etc/utmpx
> >> /etc/wtmpx
> >
> >And a bunch of other stuff. I commented those lines out and now it's
> >working after a reboot.
>
> Wow, someone definitely misunderstood this write-up
> http://stage.caldera.com/cgi-bin/ssl_reference?105610
>
> which clearly states "The above script can be run manually prior to
> shutting the system down". Your system was clearing these out as it
> was coming back up.

Current releases of OSR5 do blank utmp and utmpx during startup (it's
wrong to blank wtmp*). But the blanking is done much earlier in
startup, in /etc/bcheckrc (which is run very early out of inittab).

>Bela<

Scott McMillan

unread,
Feb 2, 2003, 11:34:40 AM2/2/03
to
On Sun, 2 Feb 2003 04:59:48 GMT, Bela Lubkin <be...@caldera.com>
wrote:

Bela,

I use the script referenced in the above TA just prior to rebooting my
5.0.[0-6] systems. Do I not need it on my 5.0.6 systems? And why is
it wrong to clear the wtmp* files? So far I've noticed no ill-effects
in doing so.

Scott McMillan

Bela Lubkin

unread,
Feb 2, 2003, 9:46:45 PM2/2/03
to sco...@xenitec.on.ca
Scott McMillan wrote:

> >> http://stage.caldera.com/cgi-bin/ssl_reference?105610


>
> I use the script referenced in the above TA just prior to rebooting my
> 5.0.[0-6] systems. Do I not need it on my 5.0.6 systems? And why is
> it wrong to clear the wtmp* files? So far I've noticed no ill-effects
> in doing so.

/etc/wtmp* contain the data used by `last`. Clearing them during a
reboot means you can't see who logged in before the reboot. You should
only do it if those files are getting corrupted (which is much less
common than /etc/utmp* corruption).

>Bela<

Reply all
Reply to author
Forward
0 new messages