Re: Add startup application by command line
You have a couple different issues here.
The GUI method you know about actually adds an app to start when you login using the .desktop method above
The update-rc.d (or more current Upstart, /etc/init/*.conf) methods both start a program when the system starts (boots), which is before you login and will start even if you don't login.
Neither are going to run a program when you login with ssh remotely. For that the simplest method is to add the command to your ~/.bashrc (but then it will also run when you open a terminal).
Another way is to create a ~/.ssh/config file and add a LocalCommand option for the host (and PermitLocalCommand) - see man ssh_config.
There are other ways with ssh as well - eg. it's simple to add the command to the ssh login command itself, but if you want to have a active shell then you would need to run a script that runs your program and opens a sub-shell. No doubt someone will chime in with a smart way to do that too.
Last edited by BkkBonanza; September 22nd, 2011 at 04:09 PM.
Send tips to: 17raXAGM42vZX21Vcb5HDwq2GMLmVwN4qd
Bookmarks