Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed the dropbox using the text based install method described here. However I'd now like dropbox to start automatically when the machine starts up, and start syncing the files. I'll need dropbox to run as the dropbox user, from the dropbox users home directory.

I think the following command will launch dropbox as the dropbox user, in the dropbox users home directory, would you correct me if this doesn't work?

LANG=en_US.UTF-8 sudo -H -u dropbox ./.dropbox-dist/dropbox end script   
share|improve this question
Doesn't putting this in your crontab, as suggested on the wiki page you referenced, work? @reboot $HOME/.dropbox-dist/dropboxd – garyjohn Nov 11 '11 at 18:36
I just looked at man 5 crontab, and it seems fedora does support that. I was actually looking at making systemd run the command as a service, but if no one known how to write a systemd startup file, I'll use that. Thanks – Varun Madiath Nov 11 '11 at 19:02

My guesses are:

  1. You specified the wrong path to the dropbox command; ./ always refers to the current directory, which is not changed by using sudo -H. You would still have to use /home/dropbox/.dropbox-dist/dropbox.

  2. Dropbox is refusing to start because of end script in the command line. It is not part of the command – the original Upstart example was supposed to be of several lines:

    start on runlevel 2
    start on runlevel 3
    start on runlevel 4
    start on runlevel 5
    stop on shutdown
        # Without next line DB does not sync non ASCII characters (ubuntu 10.04-x86_64, db 0.7.110)
        export LANG=en_US.UTF-8
        cd /home/dropbox
        exec sudo -H -u dropbox ./.dropbox-dist/dropbox
    end script

    As you can see, the Upstart config cd's to /home/dropbox before referring to ./.dropbox-dist.

For systemd, create a /etc/systemd/system/dropbox.service:

Description=Dropbox as a system service

# 'LANG' might be unnecessary, since systemd already sets the
# locale for all services according to "/etc/locale.conf".
# Run `systemctl show-environment` to make sure.


Use systemctl start dropbox.service to start the service now.

Use systemctl enable dropbox.service to make it start automatically at boot.

If you edit the unit file after it has been used once, run systemctl daemon-reload to clear the cached-in-memory one.

share|improve this answer
Nowadays it seems it's (...)/.dropbox-dist/dropboxd instead of (...)/.dropbox-dist/dropbox. Also this does not give systray icon; probably because this does not run dropbox in the context of user session. – Piotr Dobrogost Jun 17 '15 at 12:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .