2013年9月5日

Ubuntu 12.04 に Dropbox をインストールする方法

** dropbox
パッケージからインストールする
===
sudo aptitude install nautilus-dropbox -y
sudo dropbox start -i
sudo emacs /etc/init.d/dropbox
===

自動起動させるよう登録する
[/etc/init.d/dropbox]
===
#!/bin/sh
#dropbox service
DROPBOX_USERS="clothoid"

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
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
===

権限の設定など
===
sudo chmod +x /etc/init.d/dropbox
sudo update-rc.d dropbox defaults
sudo chmod -R a+rwx ~/Dropbox
===

* 環境
===
~ $ uname -a
Linux D257-A71C 3.2.0-52-generic #78-Ubuntu SMP Fri Jul 26 16:23:24 UTC 2013 i686 i686 i386 GNU/Linux
~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.3 LTS
Release: 12.04
Codename: precise
~ $ emacs --version
GNU Emacs 24.3.1
Copyright (C) 2013 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
~ $ ratpoison -v
ratpoison 1.4.6 (built Aug 27 2013 19:09:05)
Copyright (C) 2000-2008 Shawn Betts

0 件のコメント:

コメントを投稿