Results 1 to 10 of 33
Hello everybody,
I would to start my computer and right after Linux finishes booting, a terminal automatically is opened and a certain program is started. Could anyone give me a ...
- 05-02-2011 #1Just Joined!
- Join Date
- May 2011
- Posts
- 38
Auto execute program after booting
Hello everybody,
I would to start my computer and right after Linux finishes booting, a terminal automatically is opened and a certain program is started. Could anyone give me a hint how to do that?
Thanks,
Frederico Lima
- 05-02-2011 #2
hi
There are multiple places one coulWhat should that program do (i.e. userinteraction, start ui, log startup, ..)?
- 05-02-2011 #3Just Joined!
- Join Date
- May 2011
- Posts
- 38
Hello Kloschüssel,
the first problem is the autologin. I have install mingetty using:
sudo apt-get install mingetty
and I can't find the /etc/inittab which I should edit. I have read that the name changed to event.d or upstart but the ones I have seen are not the files which I should edit.
After opening one terminal, the program which should run will collect data from sensors and print them out on there. There is an infinite loop for that.
Thanks!
- 05-02-2011 #4
May this be what you're searching for?
But I'm unsure about the "after opening a terminal ...". Reading that I'm believing you want to start up normally, log in manually and finally have an icon to click on which starts your sensor application in a console. Let me know if I'm wrong.
- 05-02-2011 #5Just Joined!
- Join Date
- May 2011
- Posts
- 38
The auto login was solved using the command gdmsetup.
Now, I am trying to have some time of autostart for my program. Normally, the output of this program is displayed on the terminal which was used to start the program. So, that is why I was thinking about opening a terminal and then, executing the program....
- 05-02-2011 #6Just Joined!
- Join Date
- May 2011
- Posts
- 38
The xterm can be opened using:
Settings -> Session and Startup -> Application Autostart
I have tried to run a program using the Application Autostart but it still didn't work...
- 05-02-2011 #7Just Joined!
- Join Date
- Mar 2007
- Location
- Melbourne, Australia
- Posts
- 19
What about screen? I use it to auto start / stop my torrent server without having to login. Once I'm logged in though, I can attach to the the screen session and see what's happening.
The magic is to start screen in 'background (or detached)' mode and connect to it whenever you need to. I start my torrent server via a cronjob as follows:
I then attach to this screen session at any time by running:Code:/usr/bin/screen -S torrent -d -m -fa /usr/bin/rtorrent
Please note that you do not have to enter the full word 'torrent' (see -S torrent in my start up command) as long as there are no other screen sessions that also start with 'torr!'Code:screen -DR torr
See screen's man pages for what those options do and so much more!
Cheers,
ak.
- 05-03-2011 #8
You should be able to write a script which opens a terminal and then runs a program in it. Make the script executable and put it in your autostart.
- 05-03-2011 #9
gdm usually comes shipped with gnome. thus i assume you have a gnome frontent. you can use autostart to start an arbitrary script and you can therein start a terminal session with a specific command. the manual pages reveal how you pass a "command-to-be-executed" as arguments to the terminal.
- 05-03-2011 #10Just Joined!
- Join Date
- May 2011
- Posts
- 38
I have written a small shell script called test.sh:
Both "helloworld" and "test.sh" are located on the desktop.Code:#!/bin/bash ./helloworld bash
Using Settings -> Session and Startup -> Application Autostart, and writing the command
, it works. But when I tried to run a program which is located somewhere else other than the desktop, it didn't.Code:xterm -e ~/Desktop/test.sh


Reply With Quote