Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that i can go under system-> preferences -> startup to add in application that i want to autostart when fedora starts. But if my application requires to open terminal then type ./[appname] inorder to execute it, what should i type in the command field in the auto start section such that it will auto run at terminal upon os starts? thanks!

share|improve this question
related:… – Warren P Mar 13 '12 at 2:43
deleted =)))))) – user1157977 Mar 13 '12 at 2:44
Warren P: how can i create the .desktop file? – user1157977 Mar 13 '12 at 2:57

According to this and this, the procedure to run a script on boot for Fedora is as follows:

1: Create a bash script to do what you want, in form of

# chkconfig: 345 91 19
# description: Script to do what I want.

OWNER="myusername" # The user you want ot run the script as

case "$1" in
        echo -n "Starting Myscript: "
        #Your command follows:
        su - $OWNER -c "/usr/local/bin/myscript"
        #or possibly:
        su - $OWNER -c "screen -d -m -S myscript /usr/local/bin/myscript"
        echo $? > /var/lock/myscript
        echo "OK"
        echo -n "Shutdown Myscript: "
        kill $(cat /var/lock/myscript)
        rm -f /var/lock/myscript
        echo "OK"
        $0 stop
        $0 start
        echo "Usage: $0 start|stop|restart|reload"
        exit 1
exit 0

and save it as /etc/init.d/myscript.

2: Run as root: chkconfig --add myscript

3: Run as root: sudo ntsysv

You can then reboot or run service myscript start to start it. If you chose to run it through screen, you can get access to the program with screen -r myscript.

Note that I haven't tested this since I use Gentoo which has a different init system, so details and spelling might be off. Have fun!

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .