1

Headless Ubuntu server 14.04. I have installed dropbox (as outlined here http://ubuntuserverguide.com/2012/06/how-to-install-and-configure-dropbox-on-ubuntu-server-12-04.html) and have added the script to init.d for it to start on boot. I initially had some issues until I found out I had to add the ### BEGIN INIT INFO [...] ### END INIT INFO stuff in the file. Anyways...

So now it starts on boot:

myuser@unas14:~$ service dropbox status
dropboxd for USER myuser: running (pid 14108)

But the files in the Dropbox folder still isn't syncd. I try to run the services command as root:

myuser@unas14:~$ sudo service dropbox status
[sudo] password for myuser:
dropboxd for USER myuser: not running.

and then run the official python-script (from here https://www.dropbox.com/download?dl=packages/dropbox.py)

myuser@unas14:~$ ./dropbox.py status
Dropbox isn't running!
myuser@unas14:~$ ./dropbox.py start
Starting Dropbox...Dropbox isn't running!
Done!
myuser@unas14:~$ ./dropbox.py status
Starting...
myuser@unas14:~$ sudo service dropbox status
dropboxd for USER myuser: running (pid 14272)

so it seems the Dropbox is running for some user other than me, but still says it is running for my user? I'm really confused. When I start Dropbox manually, everything works fine. Of course until my next reboot when I have to manually start it again.

Any feedback is welcome. Thanks in advance. :)

Reply to John Smith: (Because I couldn't get the code formatting to work in comment)

myuser@unas14:~$ ps -ef|grep dropbox
myuser      1896  1837  0 12:25 pts/0    00:00:00 grep --color=auto dropbox
myuser@unas14:~$ ./dropbox.py start
Starting Dropbox...Dropbox isn't running!
Done!
myuser@unas14:~$ ps -ef|grep dropbox
myuser      2246     1 82 12:49 ?        00:00:04 /home/myuser/.dropbox-dist/dropbox-lnx.x86-2.10.52/dropbox
myuser      2276  1837  0 12:49 pts/0    00:00:00 grep --color=auto dropbox

And here is my init-script:

#! /bin/sh
#
# init script for the dynamic DNS service update utility: dropbox

### BEGIN INIT INFO
# Provides:          dropbox
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: sync dropbox files
### END INIT INFO

#  dropbox service
# Replace with linux users you want to run Dropbox clients for
DROPBOX_USERS="myuser"

DAEMON=/home/myuser/.dropbox-dist/dropbox
start() {
 echo "Starting dropbox..."
 for dbuser in $DROPBOX_USERS; do
 HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
 if [ -x $HOMEDIR/$DAEMON ]; then
 HOME="$HOMEDIR" start-stop-daemon -b -o -c $dbuser -S -u $dbuser -x $HOMEDIR/$DAEMON
 fi
 done
}

stop() {
 echo "Stopping dropbox..."
 for dbuser in $DROPBOX_USERS; do
 HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
 if [ -x $HOMEDIR/$DAEMON ]; then
 start-stop-daemon -o -c $dbuser -K -u $dbuser -x $HOMEDIR/$DAEMON
 fi
 done
}

status() {
 for dbuser in $DROPBOX_USERS; do
 dbpid=`pgrep -u $dbuser dropbox`
 if [ -z $dbpid ] ; then
 echo "dropboxd for USER $dbuser: not running."
 else
 echo "dropboxd for USER $dbuser: running (pid $dbpid)"
 fi
 done
}

case "$1" in
 start)
 start
 ;;
 stop)
 stop
 ;;
 restart|reload|force-reload)
 stop
 start
 ;;
 status)
 status
 ;;
 *)
 echo "Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart|status}"
 exit 1
 esac

exit 0
  • Please provide the output of ps -ef|grep dropbox after booting, and then after executing the Python script (start). – John WH Smith Dec 16 '14 at 23:26
  • From what I can see, Dropbox does not start at boot time. I'm guessing there's a problem with your init script. Could you post it as well? Is it executable? Did you run update-rc.d as in the tutorial you linked? – John WH Smith Dec 17 '14 at 12:12
  • I have made it executable, have run the update-rc.d and when I try it again, it says the start/stop links already exists. Is there another way to have it run at boot? Like I mentioned I had some problems with the init-script as I now need to include some kind of header in the script that I didn't need to have in 12.04. – GeGiggedy Dec 17 '14 at 12:40
  • Added the init-script in the post. – GeGiggedy Dec 17 '14 at 14:37

Your Answer

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

Browse other questions tagged or ask your own question.