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'm having a problem with Dropbox (version 1.1.35). When I first boot it takes some time before Network Manager connects to the WLAN. Then I see the Dropbox icon in the task list, claiming to be "Connecting...", but never finishing. If I exit and start it again, everything works fine. Is there any way to fix this?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Problem solved with help of Arch wiki.

/opt/dropbox/dropboxd was replaced with:

#!/bin/sh

# Copyright 2008 Evenflow, Inc., 2010 Dropbox
#
# Environment script for the dropbox executable.

start_dropbox() {
PAR=$(dirname $(readlink -f $0))
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
LD_LIBRARY_PATH=$PAR:$LD_LIBRARY_PATH 

TMP1=`ps ax|grep dropbox|grep -v grep`
if [ -n "$TMP1" ]; then
  kill -9 $(pidof dropbox) >/dev/null 2>&1
fi
exec $PAR/dropbox $@ &
}

do_dropbox() {
start_dropbox >/dev/null 2>&1
while [ 1 ]; do
  sleep 5
  ERROR="$(net_test)"
  if [ -n "$ERROR" ]; then
    LAST_ERROR=1
  else
    if [ -n "$LAST_ERROR" ]; then
      # Connection seems to be up but last cycle was down
      LAST_ERROR=""
      start_dropbox >/dev/null 2>&1
    fi
  fi
done

}

net_test() {
TMP1="$(ifconfig |grep "inet addr:" |grep -v "127.0.0.1")"
[ -z "$TMP1" ] && echo "error"
}

do_dropbox
share|improve this answer

You could use sleep to delay the start of dropbox until after your network connection is up. Put something like this in your .xinitrc or your autostart, depending on your DE or WM:

(sleep 30 && $HOME/.dropbox-dist/dropboxd) &

share|improve this answer
    
Unfortunately did not work for me :( I have add it to my .xinitrc file, but dropbox did not start at all. Are there any other ideas –  Anton Prokofiev Sep 14 '11 at 20:20
    
It has worked for me for some time now: if you issue the same command from a terminal does it start? –  jasonwryan Sep 14 '11 at 21:01
    
Thanks for the help. Problem solved, see below. Your solution was working from the command line, but not from .xinitrc –  Anton Prokofiev Sep 15 '11 at 21:14
    
@jasonwryan: This works for me from a terminal but not from within .xinitrc. Any ideas? –  Rahul Nov 6 '11 at 22:35
    
@Rahul I'm not sure why it wouldn't work from .xinitrc - I have used this method on Arch for a couple of years now with no problems... –  jasonwryan Nov 6 '11 at 22:40

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.