My guesses are:
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.
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
respawn
script
# 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:
[Unit]
Description=Dropbox as a system service
[Service]
ExecStart=/home/dropbox/.dropbox-dist/dropbox
User=dropbox
# '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.
Environment=LANG=en_US.utf-8
[Install]
WantedBy=multi-user.target
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.
@reboot $HOME/.dropbox-dist/dropboxd– garyjohn Nov 11 '11 at 18:36