Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
There are a couple of hacks on the Arch Wiki to address this issue... –  jasonwryan Jan 17 '13 at 8:15

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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