1846547 Members
2181 Online
110256 Solutions
New Discussion

Re: user login error

 
David Shao
Advisor

user login error

Today,where user login,found the error message as follows:
Terminal type set to vt100

############ ERRORS FOUND AT BOOT ############
process process not attached to terminal
Usage: who [-rbtpludAasHTqRm] [am i] [utmp_like_file]

r run level
b boot time
t time changes
p processes other than getty or users
l login processes
u useful information
d dead processes
A accounting information
a all (rbtpludA options)
s short form of who (no time since last output or pid)
H print header
T status of tty (+ writable, - not writable, x exclusive open, ? hung)
q quick who


why?
David Shao
14 REPLIES 14
Michael Tully
Honored Contributor

Re: user login error

Hi,

I am not sure why this message was displayed. It is actually the output of when you use 'who -h'. The error is likely to come from one of two places. The first is from /etc/inittab where it is trying to start some process. The other is from /sbin/init.d from one of the run-levels. You may post a copy of the '/etc/rc.log' file. Were there any new entries added to /sbin/init.d, /sbin/rc?.d ?

Michael
Anyone for a Mutiny ?
David Shao
Advisor

Re: user login error

*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:

su - tmosadm -cf 'source .login; /opt/tmos/bin/PMA_StartCleanUp' > /dev/null
David Shao
David Shao
Advisor

Re: user login error

I posted the rc.log.
When I telnet and login,display the error message.
I also found the same error message in root mail.
Message 260/267 from root Oct 16 '2002 at 8:16 pm

Date: Thu, 17 Oct 2002 08:16:28 +0800 (EAT)
Subject: cron
Status: RO

process not attached to terminal
Usage: who [-rbtpludAasHTqRm] [am i] [utmp_like_file]

r run level
b boot time
t time changes
p processes other than getty or users
l login processes
u useful information
d dead processes
A accounting information
a all (rbtpludA options)
s short form of who (no time since last output or pid)
H print header
T status of tty (+ writable, - not writable, x exclusive open, ? hung)
q quick who
David Shao
David Shao
Advisor

Re: user login error


I posted the rc.log.
When I telnet and login,display the error message.
I also found the same error message in root mail.
Message 260/267 from root Oct 16 '2002 at 8:16 pm

Date: Thu, 17 Oct 2002 08:16:28 +0800 (EAT)
Subject: cron
Status: RO

process not attached to terminal
Usage: who [-rbtpludAasHTqRm] [am i] [utmp_like_file]

r run level
b boot time
t time changes
p processes other than getty or users
l login processes
u useful information
d dead processes
A accounting information
a all (rbtpludA options)
s short form of who (no time since last output or pid)
H print header
T status of tty (+ writable, - not writable, x exclusive open, ? hung)
q quick who

*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:

su - tmosadm -cf 'source .login; /opt/tmos/bin/PMA_StartCleanUp' > /dev/null
David Shao
harry d brown jr
Honored Contributor

Re: user login error


What does the -cf option do on su??

live free or die
harry
Live Free or Die
David Shao
Advisor

Re: user login error

I don't know what's the option mean.
David Shao
T G Manikandan
Honored Contributor

Re: user login error

I would like to check your /etc/profile or .profile
or any initialization files for the user.

I suspect somewhere it has a
who am i -u

which is looking out for the terminal process and is unable to catch it out.

Please revert.

Thanks
David Shao
Advisor

Re: user login error

I found in csh login file the following line produce the error message:

#Display errors from boot
tmos_rc_display

I don't know what the 'tmos_rc_display' mean.
May be a application. I'll ask someone who is familar with the applications in my system.

I suspect that someone invaded my system and changed the .login file, because I didn't found this error message yesterday.
David Shao
David Shao
Advisor

Re: user login error

I found in csh login file the following line produce the error message:

#Display errors from boot
tmos_rc_display

I don't know what the 'tmos_rc_display' mean.
May be a application. I'll ask someone who is familar with the applications in my system.

I suspect that someone invaded my system and changed the .login file, because I didn't found this error message yesterday.
David Shao
T G Manikandan
Honored Contributor

Re: user login error

Cron: The previous message is the standard output
and standard error of one of your crontab commands:

su - tmosadm -cf 'source .login; /opt/tmos/bin/PMA_StartCleanUp' > /dev/null


The process tries opening the /dev/tty
be sure your process has stdout, stderr, and stdin all redirected somewhere.

check it up.

Thanks
David Shao
Advisor

Re: user login error

sorry.how to check.
Now, my stdout and stderr are all screen.
David Shao
Jack C. Mahaffey
Super Advisor

Re: user login error

Hi all. I'm getting the same problem by my cause is likely related to running whoami to get the current owner of the script.

Is there another way to catch the owner of the running background process without running whoami. I would really like to get rid of the error message when running my background scripts.


I need to know the owner of the process running the script in order to prevent unauthorized users from running the script.

Any other ideas?
Chris Watkins_1
Respected Contributor

Re: user login error

Jack... we use `id -u` to check the user running the script.

Something like this works fine:


if [ ! `id -u` = 123 ]
then
USER=`id -un`
echo "Run permission denied for user " ${USER}
exit 1
fi



(Where 123 is the "correct" userid)

Afraid that doesn't help our original poster, however.
Not without 2 backups and an Ignite image!
Jack C. Mahaffey
Super Advisor

Re: user login error

Chris, thanks. Using the id approach will work. I just posted a different post on the question.

Thanks a bunch. Using the id approach will work. I'll add some more code to acess the /etc/password file with a login to get the expected UID first and then compare the output from id -u.

I'm thinking something like the following:


login=root

passwdID=`grep "^${login}:" | awk -F: ' { print $3 } '`
idID=`id -u`

if [ $passwdID -eq $idID ] ; then
echo "Allowed..."
else
echo "Not Allowed "
fi