NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
irv1
Jan 22, 2012Aspirant
Bitcasa on Readynas?
Does anyone know if its likely that Bitcasa will ever be available as an addon for readynas? info http://www.bitcasa.com/about, they are planning a linux release. invites https://portal.bitcasa....
JMehring
Nov 23, 2013Apprentice
I will include the scripts I use. I assume you already have a working Bitcasa now.
I have my Bitcasa start as user admin where the user admin home directory is at /data/bitcasa. The above example I added the bitcasa user to fuse, but I also added admin since I use admin so things like rsync can access share. I had to also change '/etc/passwd' to allow admin to have a '/bin/bash' shell and changed the home directory to '/data/bitcasa'. admin is the owner if '/data/bitcasa'. You do not need to have admin as the user though. Following is my '/etc/passwd' entry for both bitcasa and admin. Choose one. Only change home folder path and or shell. IMPORTANT. You can really mess stuff up editing '/etc/passwd' directly so be careful; maybe make a backup. You may never be able to login again if you really mess it up.
I have this script located as /data/bitcasa/Bitcasa.sh. This could have been done in the /etc/init.d/bitcasa script by setting display and just running Bitcasa in background but I am too lazy to change it sine it works now :)
I have another script called /etc/init.d/Xvfb. That allow Bitcasa to run headless
Then, my last main script is /etc/init.d.bitcasa. Note at the present time I need to list which folders will be unmount manually and you would have to edit the file to reflect locations on your filesystem since it was a quick hack to get it working for only me. Its still a work in progress but normally works. Sometimes I need to go '/etc/init.d.bitcasa stop' twice to get everything to stop if there was an error.
If you make it better, let me know :) I may add code to find all directories contained in Bitcasa directory and unmount them all automatically at some point.
This all works for me just fine. Please just be careful if you are not used to tinkering in Linux.
I also heard that using Bitcasa Alpha in Linux and Windows many mess up the Windows Bitcasa files. Since I do not use Windows I don;t know if this is true or not.
I have my Bitcasa start as user admin where the user admin home directory is at /data/bitcasa. The above example I added the bitcasa user to fuse, but I also added admin since I use admin so things like rsync can access share. I had to also change '/etc/passwd' to allow admin to have a '/bin/bash' shell and changed the home directory to '/data/bitcasa'. admin is the owner if '/data/bitcasa'. You do not need to have admin as the user though. Following is my '/etc/passwd' entry for both bitcasa and admin. Choose one. Only change home folder path and or shell. IMPORTANT. You can really mess stuff up editing '/etc/passwd' directly so be careful; maybe make a backup. You may never be able to login again if you really mess it up.
admin:x:98:98::/data/bitcasa:/bin/bash
bitcasa:x:2222:2000::/data/bitcasa:/bin/bash
I have this script located as /data/bitcasa/Bitcasa.sh. This could have been done in the /etc/init.d/bitcasa script by setting display and just running Bitcasa in background but I am too lazy to change it sine it works now :)
#!/bin/sh
DISPLAY=:0 /usr/bin/Bitcasa
#su -c "DISPLAY=:0 /usr/bin/Bitcasa" -s /bin/sh bitcasa
I have another script called /etc/init.d/Xvfb. That allow Bitcasa to run headless
#! /bin/sh
### BEGIN INIT INFO
# Provides: Xvfb
# Required-Start: $local_fs $remote_fs
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
# Default-Stop:
### END INIT INFO
N=/etc/init.d/Xvfb
set -e
case "$1" in
start)
Xvfb :0 -screen 0 1024x768x24 &
;;
stop|reload|restart|force-reload)
;;
*)
echo "Usage: $N {start|stop|restart|force-reload}" >&2exit 1
;;
esac
exit 0
Then, my last main script is /etc/init.d.bitcasa. Note at the present time I need to list which folders will be unmount manually and you would have to edit the file to reflect locations on your filesystem since it was a quick hack to get it working for only me. Its still a work in progress but normally works. Sometimes I need to go '/etc/init.d.bitcasa stop' twice to get everything to stop if there was an error.
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: bitcasa
# Required-Start: $local_fs $network $remote_fs $Xvfb
# Required-Stop: $local_fs $network $remote_fs
# Should-Start: $NetworkManager
# Should-Stop: $NetworkManager
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts instance of Bitcasa
# Description: starts instance of Bitcasa using start-stop-daemon
### END INIT INFO
# Script name
NAME=bitcasa
# App name
DESC=Bitcasa
## The defaults
# Run as username
RUN_AS=admin
# Path to app SB_HOME=path_to_app_SickBeard.py
# APP_PATH=${SB_HOME-/opt/sickbeard}
APP_PATH=/data/bitcasa
# Path to store PID file
PID_FILE=${SB_PIDFILE-/var/run/bitcasa/bitcasa.pid}
#PID_FILE="/var/run/bitcasa/bitcasa.pid"
# path to python bin
DAEMON="/data/bitcasa/Bitcasa.sh"
PID_PATH=`dirname $PID_FILE`
TARGET_DIR="/data/bitcasa"
##
###test -x $DAEMON || exit 0
set -e
# Make sure the app dir is owned by us
#chown -R $RUN_AS $APP_PATH
# Create PID directory if not exist and ensure the SickBeard user can write to it
if [ ! -d $PID_PATH ]; then
mkdir -p $PID_PATH
chown $RUN_AS $PID_PATH
fi
if [ -e $PID_FILE ]; then
PID=`cat $PID_FILE`
if ! kill -0 $PID > /dev/null 2>&1; then
echo "Removing stale $PID_FILE"
rm $PID_FILE
fi
fi
case "$1" in
start)
echo "Starting $DESC"
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --exec $DAEMON -- $TARGET_DIR
;;
stop)
echo "Stopping $DESC"
#start-stop-daemon --stop --pidfile $PID_FILE --retry 15
echo "killing /usr/bin/Bitcasa"
if /bin/pidof /usr/bin/Bitcasa; then
kill -9 `/bin/pidof /usr/bin/Bitcasa`
fi
echo "killing Bitcasa.sh"
if /usr/bin/pgrep Bitcasa.sh; then
kill -9 `/usr/bin/pgrep Bitcasa.sh`
fi
echo "Unmounting /data/bitcasa/Bitcasa/Bitcasa\ Infinite\ Drive"
if ! /bin/fusermount -u /data/bitcasa/Bitcasa/Bitcasa\ Infinite\ Drive; then
echo "Could not dismount (maybe it was already dismounted)"
fi
echo "Stopped $DESC"
;;
restart|force-reload)
echo "Restarting $DESC"
#start-stop-daemon --stop --pidfile $PID_FILE --retry 15
echo "killing /usr/bin/Bitcasa"
if /bin/pidof /usr/bin/Bitcasa; then
kill -9 `/bin/pidof /usr/bin/Bitcasa`
fi
echo "killing Bitcasa.sh"
if /usr/bin/pgrep Bitcasa.sh; then
kill -9 `/usr/bin/pgrep Bitcasa.sh`
fi
echo "Unmounting /data/bitcasa/Bitcasa/Bitcasa\ Infinite\ Drive"
if ! /bin/fusermount -u /data/bitcasa/Bitcasa/Bitcasa\ Infinite\ Drive; then
echo "Could not dismount (maybe it was already dismounted)"
fi
echo "Stopped $DESC"
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --exec $DAEMON -- $TARGET_DIR
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
If you make it better, let me know :) I may add code to find all directories contained in Bitcasa directory and unmount them all automatically at some point.
This all works for me just fine. Please just be careful if you are not used to tinkering in Linux.
I also heard that using Bitcasa Alpha in Linux and Windows many mess up the Windows Bitcasa files. Since I do not use Windows I don;t know if this is true or not.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!