3

I installed dropbox on my ubuntu 16.04 following the instructions from http://www.dropboxwiki.com/tips-and-tricks/install-dropbox-in-an-entirely-text-based-linux-environment

Launched the server with the pyton script and linked to my dropbox account. Everything works fine, I can sync my files as expected.

fmf@kodi:~$ ls -al |grep dropbox-dist
drwxr-xr-x  3 fmf  fmf       4096 Aug  1 18:05 .dropbox-dist
fmf@kodi:~$

fmf@kodi:~$ ll .dropbox-dist/
total 20
drwxr-xr-x  3 fmf fmf 4096 Aug  1 18:05 ./
drwxr-xr-x 31 fmf fmf 4096 Aug  3 10:27 ../
-rwxr-xr-x  1 fmf fmf   99 Aug  1 18:05 dropboxd*
drwxr-xr-x  9 fmf fmf 4096 Aug  1 18:05 dropbox-lnx.x86_64-8.3.16/
-rw-r--r--  1 fmf fmf    6 Aug  1 18:05 VERSION
fmf@kodi:~$

fmf@kodi:~$ ./dropbox.py start
Starting Dropbox...Done!
fmf@kodi:~$ ./dropbox.py status
Up to date
fmf@kodi:~$

Now I'd like to have it run at boot, so in the same web page I found instructions to create /etc/init.d/dropbox and set USER to my user. I run update-rc.d and tried to reboot. After reboot the daemon is not running.

So I checked:

fmf@kodi:~$ sudo journalctl -u dropbox
-- Logs begin at Wed 2016-08-03 10:25:51 CEST, end at Wed 2016-08-03 10:36:35 CEST. --
Aug 03 10:26:37 kodi systemd[1]: Starting LSB: dropbox service...
Aug 03 10:26:37 kodi systemd[1]: dropbox.service: Control process exited, code=exited status=203
Aug 03 10:26:37 kodi systemd[1]: Failed to start LSB: dropbox service.
Aug 03 10:26:37 kodi systemd[1]: dropbox.service: Unit entered failed state.
Aug 03 10:26:37 kodi systemd[1]: dropbox.service: Failed with result 'exit-code'.
fmf@kodi:~$

fmf@kodi:~$ systemctl status dropbox.service -l
● dropbox.service - LSB: dropbox service
   Loaded: loaded (/etc/init.d/dropbox; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2016-08-03 10:26:37 CEST; 10min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3147 ExecStart=/etc/init.d/dropbox start (code=exited, status=203/EXEC)

Aug 03 10:26:37 kodi systemd[1]: Starting LSB: dropbox service...
Aug 03 10:26:37 kodi systemd[1]: dropbox.service: Control process exited, code=exited status=203
Aug 03 10:26:37 kodi systemd[1]: Failed to start LSB: dropbox service.
Aug 03 10:26:37 kodi systemd[1]: dropbox.service: Unit entered failed state.
Aug 03 10:26:37 kodi systemd[1]: dropbox.service: Failed with result 'exit-code'.
fmf@kodi:~$

What am I doing wrong?

4

I finally managed to have dropbox to start at boot. I discovered that ubuntu 16.04 uses systemd, so I wrote a unit configuration file for dropbox:

fmf@kodi:~$ cat /etc/systemd/system/dropbox.service
[Unit]
Description=Dropbox Service
After=network.target

[Service]
ExecStart=/bin/sh -c '/usr/local/bin/dropbox start'
ExecStop=/bin/sh -c '/usr/local/bin/dropbox stop'
PIDFile=${HOME}/.dropbox/dropbox.pid
User=fmf
Group=fmf
Type=forking
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target
fmf@kodi:~$

Then I made a link to the official python script to control dropbox:

fmf@kodi:~$ sudo ln -sf /home/fmf/dropbox.py /usr/local/bin/dropbox

And enabled the service:

fmf@kodi:~$ sudo systemctl enable dropbox.service

After a reboot dropbox is running as expected.

  • 1
    Since they can't yet comment, @Steven mentioned that chmod +x /usr/local/bin/dropbox was needed for them. – Chai T. Rex Nov 17 '17 at 7:01
  • This would only work for one user (yourself) unless the dropbox executable is world readable? – Ackis Jan 4 '18 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.