3

I've got a systemd service file dropbox.service set up as follows:

[Unit]
Description=dropbox
After=local-fs.target network.target

[Service]
User=romeovs
ExecStart=/usr/bin/dropboxd

[Install]
WantedBy=multi-user.target

this succesfully starts the dropbox daemon if it is run any time after boot. Something seems to go wrong when I enable it to run at boot though. dropbox status just shows that dropbox is Connecting....

My guess is that the network needs to be fully up before dropbox is started. How can I force this with systemd?

romeovs
  • 1,660
  • 5
  • 21
  • 33
  • There are a couple of [hacks on the Arch Wiki](https://wiki.archlinux.org/index.php/Dropbox#Connecting...) to address this issue... – jasonwryan Jan 17 '13 at 08:15

1 Answers1

1

As a quick hack:

[Unit]
Description=dropbox
After=local-fs.target network.target

[Service]
User=romeovs
ExecStartPre=sh -c 'while ! ping -c1 dropbox.com >/dev/null; do sleep 1; done'
ExecStart=/usr/bin/dropboxd

[Install]
WantedBy=multi-user.target

Should work independently of what any network manager reports.

Chris Down
  • 122,090
  • 24
  • 265
  • 262