[HOWTO] Dropbox (CLI) in OMV

Installation, suggestions and any issues you may have with any of the plugins for OMV.

[HOWTO] Dropbox (CLI) in OMV

Postby Solo0815 » Sat 14. Jul 2012, 17:56

Got Dropbox up and working: (thx to the authors of this blog-posts [1] [2])
all kudos go to them ;)

Tutorial Version 0.2:
32-bit:
Code: Select all
cd ~ && wget -O - "http://www.dropbox.com/download?plat=lnx.x86" | tar xzf -

64-bit:
Code: Select all
cd ~ && wget -O - "http://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -


execute
Code: Select all
~/.dropbox-dist/dropboxd


move dropbox (binary) folders to /opt and create a link:
Code: Select all
mv .dropbox /opt/dropbox
mv .dropbox-dist /opt/dropbox-dist
ln -s /opt/dropbox .dropbox
ln -s /opt/dropbox-dist .dropbox-dist


create a "Shared Folder" in OMV for your Dropbox-Content and link it with the Dropbox-(Document)-Folder in /home/user/
Code: Select all
mv ~/Dropbox Dropbox_old
ln -s /your/path/to/the_new_created/folder ~/Dropbox


Put this in /etc/init.d/dropbox and edit line
DROPBOX_USERS="yourusername"
to match a username in OMV, _not_ your dropbox-name

Code: Select all
#! /bin/sh
# /etc/init.d/dropbox
#
# AUTHOR: Solo0815 - based on this script: http://www.fene-blog.de/linux/dropbox-unter-linux-debian-ohne-gui-einrichten/
# Correctly starts / stops / restarts dropbox at system startup

### BEGIN INIT INFO
# Provides: dropbox
# Required-Start: $remote_fs $syslog $all
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO

# Some things that run always

set -e

# Must be a valid filename
NAME=dropbox
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"

# dropbox service
# This must be a user on the OMV-System, _not_ your dropbox-username
DROPBOX_USERS="yourusername"

DAEMON=.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 $DAEMONOPTS
        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

execute
Code: Select all
chmod +x dropbox
update-rc.d dropbox defaults

dropbox should run on the next reboot
Miss you Dad!

No Support through PM, please open a new thread.
[b]HowTo's / Tutorials for OMV:
http://forums.openmediavault.org/viewtopic.php?f=13&t=1289

Please post Logs on http://pastebin.com/
User avatar
Solo0815
 
Posts: 814
Joined: Wed 11. Jul 2012, 17:47
Location: Germany - Deutschland, Bayern, Oberfranken

Re: [HOWTO] Dropbox (CLI) in OMV

Postby stonerhawk » Sun 15. Jul 2012, 16:42

What is "yourusername"?
I've put admin, but it seems not working
stonerhawk
 
Posts: 20
Joined: Fri 13. Jul 2012, 08:30

Re: [HOWTO] Dropbox (CLI) in OMV

Postby Solo0815 » Tue 17. Jul 2012, 16:01

try "root", not "admin"
Miss you Dad!

No Support through PM, please open a new thread.
[b]HowTo's / Tutorials for OMV:
http://forums.openmediavault.org/viewtopic.php?f=13&t=1289

Please post Logs on http://pastebin.com/
User avatar
Solo0815
 
Posts: 814
Joined: Wed 11. Jul 2012, 17:47
Location: Germany - Deutschland, Bayern, Oberfranken

Re: [HOWTO] Dropbox (CLI) in OMV

Postby qubabos » Thu 2. Aug 2012, 07:49

everything works exept put script in init.d

after
Code: Select all
chmod +x dropbox
update-rc.d dropbox defaults

i got :
Code: Select all
update-rc.d: using dependency based boot sequencing
insserv: Script dropbox is broken: incomplete LSB comment.
insserv: missing `Provides:' entry: please add.
insserv: missing `Required-Start:' entry: please add even if empty.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: missing `Default-Start:'  entry: please add even if empty.
insserv: missing `Default-Stop:'   entry: please add even if empty.
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `dropbox'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `dropbox'
qubabos
 
Posts: 14
Joined: Mon 9. Jul 2012, 16:27

Re: [HOWTO] Dropbox (CLI) in OMV

Postby Solo0815 » Thu 2. Aug 2012, 10:42

please post the output of
Code: Select all
cat /etc/init.d/dropbox
Miss you Dad!

No Support through PM, please open a new thread.
[b]HowTo's / Tutorials for OMV:
http://forums.openmediavault.org/viewtopic.php?f=13&t=1289

Please post Logs on http://pastebin.com/
User avatar
Solo0815
 
Posts: 814
Joined: Wed 11. Jul 2012, 17:47
Location: Germany - Deutschland, Bayern, Oberfranken

Re: [HOWTO] Dropbox (CLI) in OMV

Postby qubabos » Thu 2. Aug 2012, 12:18

Code: Select all
root@omv:~# cat /etc/init.d/dropbox
    #! /bin/sh
    # /etc/init.d/dropbox
    #
    # AUTHOR: Solo0815 - based on this script: http://www.fene-blog.de/linux/dropbox-unter-linux-debian-ohne-gui-einrichten/
    # Correctly starts / stops / restarts dropbox at system startup

    ### BEGIN INIT INFO
    # Provides: dropbox
    # Required-Start: $remote_fs $syslog $all
    # Required-Stop: $remote_fs $syslog
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Start daemon at boot time
    # Description: Enable service provided by daemon.
    ### END INIT INFO

    # Some things that run always

    set -e

    # Must be a valid filename
    NAME=dropbox
    PIDFILE=/var/run/$NAME.pid
    #This is the command to be run, give the full pathname

    export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"

    # dropbox service
    # This must be a user on the OMV-System, _not_ your dropbox-username
    DROPBOX_USERS="xbmc"

    DAEMON=.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 $DAEMONOPTS
            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
qubabos
 
Posts: 14
Joined: Mon 9. Jul 2012, 16:27

Re: [HOWTO] Dropbox (CLI) in OMV

Postby Solo0815 » Thu 2. Aug 2012, 14:52

are you in /etc/init.d/, when you execute chmod +x dropbox?

Please try
Code: Select all
chmod +x /etc/init.d/dropbox
update-rc.d dropbox defaults

and then post the output of
Code: Select all
ls -l /etc/init.d/dropbox

Of course you have to be "root" when doing all this ;)
Thx
Miss you Dad!

No Support through PM, please open a new thread.
[b]HowTo's / Tutorials for OMV:
http://forums.openmediavault.org/viewtopic.php?f=13&t=1289

Please post Logs on http://pastebin.com/
User avatar
Solo0815
 
Posts: 814
Joined: Wed 11. Jul 2012, 17:47
Location: Germany - Deutschland, Bayern, Oberfranken

Re: [HOWTO] Dropbox (CLI) in OMV

Postby qubabos » Thu 2. Aug 2012, 14:59

i know that :) folder is right, also try with full path, and i am root, not su... :)
qubabos
 
Posts: 14
Joined: Mon 9. Jul 2012, 16:27

Re: [HOWTO] Dropbox (CLI) in OMV

Postby Solo0815 » Fri 3. Aug 2012, 08:28

You can try
Code: Select all
insserv dropbox

Whats the output of:
Code: Select all
/etc/init.d/dropbox
ls -l /etc/init.d/dropbox
Miss you Dad!

No Support through PM, please open a new thread.
[b]HowTo's / Tutorials for OMV:
http://forums.openmediavault.org/viewtopic.php?f=13&t=1289

Please post Logs on http://pastebin.com/
User avatar
Solo0815
 
Posts: 814
Joined: Wed 11. Jul 2012, 17:47
Location: Germany - Deutschland, Bayern, Oberfranken

Re: [HOWTO] Dropbox (CLI) in OMV

Postby qubabos » Fri 3. Aug 2012, 18:12

Code: Select all
root@omv:~#     insserv dropbox
insserv: Script dropbox is broken: incomplete LSB comment.
insserv: missing `Provides:' entry: please add.
insserv: missing `Required-Start:' entry: please add even if empty.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: missing `Default-Start:'  entry: please add even if empty.
insserv: missing `Default-Stop:'   entry: please add even if empty.
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `dropbox'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `dropbox'

Code: Select all
root@omv:~# /etc/init.d/dropbox
Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart|status}

Code: Select all
root@omv:~# ls -l /etc/init.d/dropbox
-rwxr-xr-x 1 root root 2314 08-02 08:45 /etc/init.d/dropbox
qubabos
 
Posts: 14
Joined: Mon 9. Jul 2012, 16:27

Next

Return to Plugins

Who is online

Users browsing this forum: Bing [Bot] and 4 guests