Operating System - HP-UX
1834165 Members
2019 Online
110064 Solutions
New Discussion

Re: starting application when I login

 
Henry Chua
Super Advisor

starting application when I login

Hi Guys,

Is there a way I can make the system run a certain application i wrote when i log in?

Best regards
Henry
7 REPLIES 7
Bharat Katkar
Honored Contributor

Re: starting application when I login

Yes ....

You can put that in your profile.
Say if you using bash shell then put that in
/.bashrc
IF usign ksh then .profile file.

If you want all of the users to start the application when they login then you can set it in system wide profile i.e. /etc/profile

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Fabio Ettore
Honored Contributor

Re: starting application when I login

Hi Henry,

which way to login? Do you want to launch your application on login by all services?

I am thinking about $HOME/.profile and insert the start line of your application at the end of the file. But keep in mind that means every times you login with that user then the application starts.

Just a thought...

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
James R. Ferguson
Acclaimed Contributor

Re: starting application when I login

Hi Henry:

In addition to having your application coded in the $HOME/.profile so that it runs everytime you login, you can setup accounts (users) where the last field of their '/etc/passwd' entry contains the full path of your application instead of a shell.

This is often done when you want a menu-based script to run in lieu of giving the user a shell in which to work.

Regards!

...JRF...
Peter Godron
Honored Contributor

Re: starting application when I login

Henry,
James solution has the added benefit of leaving the user without a shell, if they do manage to escape from your application.
Without shell the user will not be able to do anything.
Chan 007
Honored Contributor

Re: starting application when I login

Add to the users /$HOME/.profile

That will be the best idea.

Chan
Arunvijai_4
Honored Contributor

Re: starting application when I login

Hi Henry,

For a particular, you need to put in $HOME/.profile

and System wide,

/etc/profile.

You can just add a command to run the application.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Carlos Roberto Schimidt
Regular Advisor

Re: starting application when I login

Is possible put complete path from your application in /etc/passwd instead shell, or you can use this at end in the user .profile:

# exec your_app

If you use exec, when user quit from application, can not return to shell.

Schimidt