SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello... I am trying to figure out how to automatically start Dropbox at login (not startup). I am running Slackware 14 and using bash shell. The command that I use to start Dropbox is:
~/.dropbox-dist/dropboxd
When I issue this command while I'm logged in it works fine.
I tried putting it in my /etc/rc.d/rc.local but when I rebooted it would continually error indicating that an account was not setup.
Hi Mina86,
If you add it in .bashrc, it will be executed every time if you open a new shell or subshell. So if we want to execute only one time after the user login, add the entry in ~/.bash_profile or .bash_login
PS:- .bash_login will check only if .bash_profile not exist on the user home directory.
I don't have a ~/.bash_profile so I created one in my home directory and chmod it to 755. I added the ~/.dropbox-dist/dropboxd to it and rebooted but it didn't startup. I read the link http://www.thegeekstuff.com/2008/10/...d-bash_logout/ and it gave an example of the /etc/profile but it looks completely different than mine and I can't see where it would call the .bash_profile file. I am running bash shell though.
I was able to get it to work by creating rc.dropbox and editing rc.local. See the link below for the details. The link didn't mention that you have to chmod 755 the rc.dropbox and that the "username" variable refers to your local account name on the Linux box and not your Dropbox username.
If you add it in .bashrc, it will be executed every time if you open a new shell or subshell. So if we want to execute only one time after the user login, add the entry in ~/.bash_profile or .bash_login
That's why there's ps and grep which guarantees that the daemon is started unless it's already running.
Quote:
Originally Posted by tifcg
I don't have a ~/.bash_profile so I created one in my home directory and chmod it to 755.
You don't have to make it executable.
Quote:
Originally Posted by tifcg
I added the ~/.dropbox-dist/dropboxd to it and rebooted but it didn't startup.
Yeah, it won't start after reboot, but only once you log in.
Quote:
Originally Posted by tifcg
I can't see where it would call the .bash_profile file.
That's why there's ps and grep which guarantees that the daemon is started unless it's already running.
I understand that.. but why you want to add the entry in bashrc. We need to run that only once after the user login to the system.... not to run every time if the user go to a subshell or new console tab. If you add that in bashrc, it will check that every time, if the user open a tab or new shell. So .bash_profile is the best place for that script.
I understand that.. but why you want to add the entry in bashrc. We need to run that only once after the user login to the system.... not to run every time if the user go to a subshell or new console tab. If you add that in bashrc, it will check that every time, if the user open a tab or new shell. So .bash_profile is the best place for that script.
Why not? Also, it will restart the daemon should it die for whatever reason. Point is, it does not really matter that much.
Why don't you put a script launching the dropboxd daemon OR a .desktop file pointing to it under your ~/.config/autostart directory?
It was designed for these kind of tasks without resorting to other tricks...
Why not? Also, it will restart the daemon should it die for whatever reason. Point is, it does not really matter that much.
Hi Mina86,
Try to understand the concept instead of arguing....I am stopping this. Your method is good, but what I am suggesting is that use the same code in .bash_profile instead of .bashrc.
Just to say if anyone happens across this thread (as I did) while searching for an answer to this very question, the code suggested does work if added to .bash_profile but you need to make sure there is a '&' at the end, thus:
Worked for me in fluxbox. Without the '&' I would hit enter and it would hang without logging in. Luckily I was ssh'd in so I could make the adjustment.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.