LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-17-2003, 12:21 PM   #1
paul.sheldon
LQ Newbie
 
Registered: Sep 2003
Posts: 3

Rep: Reputation: 0
Getting tty error message running autostart script.


I have installed Oracle 9.2.0.1 on RH9. I am trying to get it to autostart when the machine boots. I have an autostart script, and I modified rc.local to call the script.

When the machine boots up, the database starts ok. So the script seems to work. However, i get the following message when the machine boots up and is running my script:

mesg: error: tty device is not owned by group 'tty'

Can anyone tell me what is causing this error from my script?

Here is my script, it is located in /home/oracle/scripts/

#
# Oracle autostart script
#
start()
{
echo -n "Starting Oracle Database: "
echo "-------------------------------------------------------" >> /home/oracle/log/oracled
date +" %T %a %D :Starting Oracle as part of system startup. " >> /home/oracle/log/oracled
echo "-------------------------------------------------------" >> /home/oracle/log/oracled
su - oracle -c dbstart >> /home/oracle/log/oracled
echo "Done."
echo -n "Starting Oracle Listner: "
su - oracle -c "lsnrctl start" >> /home/oracle/log/oracled
echo "Done."
echo
echo "-------------------------------------------------------" >> /home/oracle/log/oracled
date +" %T %a %D :Finished. " >> /home/oracle/log/oracled
echo "-------------------------------------------------------" >> /home/oracle/log/oracled
exit
touch /var/lock/subsys/oracled
}
stop()
{
echo -n "Stoping Oracle Listener: "
echo "-------------------------------------------------------" >> /home/oracle/log/oracled
date +" %T %a %D :Stoping Oracle as part of system shutdown. " >> /home/oracle/log/oracled
echo "-------------------------------------------------------" >> /home/oracle/log/oracled
su - oracle -c "lsnrctl stop" >> /home/oracle/log/oracled
echo "Done."
echo -n "Stoping Oracle Database: "
su - oracle -c dbshut >> /home/oracle/log/oracled
echo "Done."
echo
echo "-------------------------------------------------------" >> /home/oracle/log/oracled
date +" %T %a %D :Finished. " >> /home/oracle/log/oracled
echo "-------------------------------------------------------" >> /home/oracle/log/oracled
exit
rm -rf /var/lock/subsys/oracled
}

case "$1" in
start)
start
;;
stop)
;;
restart)
stop
sleep 3
start
;;
*)
echo "Usage: oracled {start|stop|restart}"
exit 1
esac


Here is the line in rc.local that calls the script:

# Added to start oracle on boot
. /home/oracle/scripts/oracled
 
Old 10-17-2003, 07:19 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"Can anyone tell me what is causing this error from my script?"

Check your tty devices. Log in as root and issue this command:
ls -l /dev/tty* | less

Some of the tty devices should have a group name of tty. In particular the tty device assigned to whatever username is running Oracle (oracle?) should probably have a group name of tty.




___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Last edited by jailbait; 10-17-2003 at 07:20 PM.
 
Old 10-18-2003, 11:12 AM   #3
paul.sheldon
LQ Newbie
 
Registered: Sep 2003
Posts: 3

Original Poster
Rep: Reputation: 0
ok. i'm still a bit of a newbie here....

i do have a user named oracle that owns and runs all the Oracle database stuff.

from /dev , how do i know which tty device is assigned to oracle?
 
Old 10-18-2003, 02:12 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"from /dev , how do i know which tty device is assigned to oracle?"

You are looking for a device with a name in the form of /dev/ttyx, where x is a number, and /dev/ttyx has an owner of oracle and a group name of tty. Take a look at your /dev/ttyx devices with the following command:

ls -l /dev/tty* | less

If oracle owns a tty which has an incorrect group name then change the group name to tty with a command patterned after:

chown oracle:tty /dev/tty7

If there is no /dev/ttyn owned by oracle you may have to delete the user oracle and recreate it. Practice first on a name like delphi to make sure this will solve the problem before you delete oracle.

Also is the problem nothing more than a nuisance? Does Oracle go ahead and work OK anyway?

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Last edited by jailbait; 10-18-2003 at 02:14 PM.
 
Old 10-18-2003, 02:27 PM   #5
paul.sheldon
LQ Newbie
 
Registered: Sep 2003
Posts: 3

Original Poster
Rep: Reputation: 0
yeah, the error message is just a nuisance when the machine boots; which i know will rarely ever happen since it is up 24x7. i was curious if there was an easy fix. the oracle database starts up and works just fine.

i don't have any /dev/ttyx owned by oracle. they are all owned by root and have a group of either tty or uucp. i did try to add the oracle user to the tty group, but that didn't work.

i tried creating a new user, delphi, to see if a tty device showed up in /dev as being owned by delphi. it did not. my guess is that when i create a new user, i'm using the RH User Manager, which is run as root; so when it creates new users, the tty devices are owned by root. is that guess correct?

is there something in my script i could change that would avoid the error mesg? do you think this is even worth trying to fix?
 
Old 10-18-2003, 03:43 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
" i'm using the RH User Manager, which is run as root; so when it creates new users, the tty devices are owned by root. is that guess correct?"

You are correct in that the RH User Manager is the program that should be setting the ownership of a tty to each new user. The fact that you are running RH User Manager as root is irrelevant to the problem.

"they are all owned by root and have a group of either tty or uucp. "

Probably Red Hat handles tty ownership differently than SuSE or Oracle expects. Maybe the user oracle is being assigned to a tty with a user name of uucp and Oracle is reporting that as an error, which it would be an error on SuSE.

"do you think this is even worth trying to fix?"

Only for the sake of neatness. The best way to fix this problem is to report it to Oracle as a minor bug in Oracle.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Last edited by jailbait; 10-18-2003 at 03:44 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script adding autostart gnome script Coolrunr Programming 3 01-01-2009 02:23 PM
Exiting the Shell script with Error MEssage sumitarun Programming 5 04-14-2005 01:10 AM
error running script on crontab haora Linux - Newbie 3 03-11-2005 04:02 PM
cron error when running script? meeble Linux - Software 3 09-09-2004 05:00 PM
Executing PHP script- error message vfulco Linux - Newbie 3 07-13-2004 10:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration