Add dropbox daemon sync service at boot on debian

Create a file /etc/init.d/dropbox:

#!/bin/sh
### BEGIN INIT INFO
# Provides:          dropbox
# Required-Start:    $local_fs $remote_fs $network mysql
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Starts Dropbox Daemon
# Description:       starts Dropbox Daemon
### END INIT INFO

# Change the value of "user" to linux user name who runs seafile
user=root

# Change the value of "seafile_dir" to your path of seafile installation
# usually the home directory of $user
dropbox_dir=/root/.dropbox-dist
script_path=${dropbox_dir}


#
# Write a polite log message with date and time
#


case "$1" in
        start)
                echo Starting Dropbox daemon
                sudo -u ${user} ${script_path}/dropboxd &
        ;;
        restart)
                echo Stopping Dropbox daemon
                sudo -u ${user} killall dropbox
                echo Restarting Dropbox daemon
                sudo -u ${user} ${script_path}/dropboxd &
        ;;
        stop)
                echo Stopping Dropbox daemon
                sudo -u ${user} killall dropbox
        ;;
        *)
                echo "Usage: /etc/init.d/dropbox {start|stop|restart}"
                exit 1
        ;;
esac

Give permissions:

chmod +x /etc/init.d/dropbox

Add to boottime:

cd /etc/rc3.d
ln -s ../init.d/dropbox S95{dropbox}

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.