J C
asked on
Start program at startup in specific tty?
Hello all,
I would like to know how I can start a program at (or after) start up in a specific console (anything above 1). I am running FC2 and just want to make sure this program starts back up after reboot.
Thanks,
GR
I would like to know how I can start a program at (or after) start up in a specific console (anything above 1). I am running FC2 and just want to make sure this program starts back up after reboot.
Thanks,
GR
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
About the #!/bin/sh (notice no space), this is not strictly needed but should be included. This tells the system which command interpreter to use to execute the script. In this case use /bin/sh (bourne shell). If you did not include this the system would use it's default shell (most Linux distributions use BASH, some systems use Korn shell, etc.) Some commands act differently in different shells.
If you want a commant to run whenever you login on certain terminals then put this in your .profile (or other startup script depending on your defaul shell):
TTY=`tty`
TT1=`basename $TTY`
TT2=`echo $TT1 | sed 's/[^0-9]//g'`
if [ "$TT2" -gt 1 ]
then
# Insert your command here.
fi
This will run everytime you login. If you only want it to run the first time you login you will need to add some further checks.
If you want a commant to run whenever you login on certain terminals then put this in your .profile (or other startup script depending on your defaul shell):
TTY=`tty`
TT1=`basename $TTY`
TT2=`echo $TT1 | sed 's/[^0-9]//g'`
if [ "$TT2" -gt 1 ]
then
# Insert your command here.
fi
This will run everytime you login. If you only want it to run the first time you login you will need to add some further checks.
ASKER
I'm sorry if I was not clear before, but what I need is to start a program after a reboot in a console (tty5). This would need to be done without any user intervention. I can run the program after start up, but would like to run it in a console. I appreciate all your help.
Thanks,
GR
Thanks,
GR
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the help guys!
GR
GR
ASKER
Thanx
GR