How to auto run commands during user login on Linux

, , No Comments

This week while installing Oracle 11g on Oracle Linux Server, I needed to automatically start some programs when the user logins in.

Here is why. Oracle Linux boots, by default, into a command line terminal or console. But to use the Oracle 11g Database Control application, you'll need to start the GUI X window. The command to do that is $ startx
The other issue is, the GUI launches into a blank desktop, no applications center or start menu bar. To start any program you'll have to right click, launch the Terminal and start you program via the command line.
For me this is no issue, but the intended end user of this Oracle 11g aren't that Linux savvy. I wanted them to just start the system and the X window would start automatically once they login and the dbconsole would be started too and finally Firefox would launch and open http://localhost:1158/em automatically.

Well, it was easy to accomplish. All I did was to edit the ~/.bash_profile file. I added the following lines -
emctl start dbconsole
firefox http://localhost:1158/em

And voila, that did it.


Post a Comment

You can be sure of a response, a very relevant one too!

Click on Subscribe by Email just down below the comment box so you'll be notified of my response.