Automatically execute a software without gui at boot

hi all,
this is my first post here...i hope that this is the correct section to write my question.

I have a distro linux without gui, only text mode.
So, it's possible run automatically a command or a program as "top" or "ping" and get the result on the main shell , after the boot and after username and password input ?
I don't want run the command or the software as a service (init.d/.....).

Thanks to all.
Regards
Emiliano

can you please be spcific wht exactly you want

Yes - there is a console. The console is analagous to the DOS window in Windows XP, in the sense that you can execute commands that do not require gnome or some other windowing interface, like ls and top.

Since you've given almost no information about your system, that is all I can say for now.

What's your system?

Certainly it's possible. I've made login systems that ran top, another that generated openvpn keys, and another that played a 'net radio station on login. Among other things.

How depends on your system, which you haven't stated yet. What is it?

Hi all ,
thanks for yours sentences.
So,
my distro is an ubuntu distro for beagle board...... you know?
It's like a mini pc.
I need to run automatically a program in my main shell.
Those are the steps that i do when turn on the minipc.

  1. Turn on minipc (very easy);
  2. Waiting for loading kernel while request user and password input.
  3. I type username and password on screen (emi - emi);
  4. i type on my shell this commands : ping;
  5. I open another shell with keys combination : ALT+Fx(x is my number shell:2-3-4-5)
  6. I type the "top" command;
  7. I see the command's results on my shells.

So, i would like to run automatically those command and see the result on screen.
I don't know how to do that. Im at beginning of this world.
I don't want a service that run in background or at least , if it's only possible build up a service, i would like to see the result of my service on my shell.

Thank to all.
PS : Unfortunately I have no other information about the system.

Regards

Emiliano.

Assuming you are using Bash, one way would be to add the required commands (top, ping) to your ~/.bash_profile.

I am more familiar with Fedora and Redhat so I can't provide exact steps to follow, but what you want to accomplish is:

  1. Autologin to 2 virtual terminals
  2. start your program from ~/.bashrc and direct it to run on the appropriate terminal.

If you add this code to ~/.bashrc it will do the trick.
Note that as written, it checks to see if there are running processes on tty10 (that you are logged in) and that top is not running. If not, then run top. Same procedure is followed for ping, using tty11.

<code>
ps -a | grep tty10 | grep -v top && top

ps -a | grep tty11 | grep -v ping && ping 192.168.1.2

</code>

If login shells are established via /etc/inittab then you would have to start autologin getty's for tty10 and 11 as I have written it (you can use whichever ones you want for it).

I would add that to me this is a horrifying bit of code. It works properly ONLY because it runs from .bashrc. Otherwise the checks for what is happening in the system before initializing the programs would be totally inadequate.