Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

125 lines (99 sloc) 6.251 kb
Greyhole Installation Instructions
==================================
Greyhole comes as RPM or DEB packages. If your distribution supports those, you should definitely install one of them.
They are available from http://greyhole.net/download/
Once you did, look in /usr/share/greyhole/USAGE (or online https://raw.github.com/gboudreau/Greyhole/master/USAGE) for configuration instructions.
If you can't install a pre-packaged version, follow the steps below to install from source.
The following instructions have been tested on Fedora 12, and Ubuntu 9 & 10.
If you know what you're doing, you should have no problem installing on any other Linux variant.
Amahi (http://www.amahi.org) comes with Greyhole pre-installed.
If you're looking for an easy way to try Greyhole, in a virtual machine or a spare computer, installing Amahi might be the easiest way to get a working Greyhole install.
More info about Greyhole on Amahi: http://wiki.amahi.org/index.php/Greyhole
Note: Samba 3.4.3 (and 3.3.9) fix a bug that affects Greyhole functionnality.
See http://www.samba.org/samba/history/samba-3.4.3.html - BUG 6769: Fix symlink unlink. - https://bugzilla.samba.org/show_bug.cgi?id=6769
With this bug present, trying to delete files on Greyhole shares will not work!
Make sure the Samba version you use includes this fix, or isn't affected by this bug.
Also, there have been reports that the Debian-bundled version of Samba would sometime show symlinks as 0-bytes files, to clients.
If you have such issues, you should upgrade to Samba 3.5+ from the Sernet repo, using instructions such as http://www.faqforge.com/linux/distributions/centos/updating-samba-on-centos-5/
or compile the latest Samba stable manually and use that.
1. Install the required applications: PHP 5+ (cli) with MySQL & mbstring extensions, MySQL server, Samba, rsync, GCC (etc.):
Fedora: yum -y install mysql-server php php-mysql php-mbstring php-intl samba samba-common patch gcc yum-utils php-pear rsync
Ubuntu: apt-get -y install mysql-server php5-cli php5-mysql php-intl samba samba-common samba-common-bin build-essential php-pear rsync
2. Install Greyhole (as root):
Get the latest Source Install TGZ from http://greyhole.net/download/
tar zxf greyhole-*.tar.gz
cd greyhole-*
GREYHOLE_INSTALL_DIR=`pwd`
mkdir -p /var/spool/greyhole
chmod 777 /var/spool/greyhole
install -m 0755 -D -p initd_script.sh /etc/init.d/greyhole
install -m 0755 -D -p greyhole /usr/bin
install -m 0755 -D -p greyhole-dfree /usr/bin
install -m 0644 -D -p logrotate.greyhole /etc/logrotate.d/greyhole
install -m 0644 -D -p greyhole.cron.d /etc/cron.d/greyhole
install -m 0644 -D -p greyhole.example.conf /etc/greyhole.conf
install -m 0755 -D -p greyhole.cron.weekly /etc/cron.weekly/greyhole
install -m 0755 -D -p greyhole.cron.daily /etc/cron.daily/greyhole
install -m 0644 -D -p docs/greyhole.1.gz /usr/share/man/man1/
install -m 0644 -D -p docs/greyhole-dfree.1.gz /usr/share/man/man1/
install -m 0644 -D -p docs/greyhole.conf.5.gz /usr/share/man/man5/
if [ -f includes/common.php ]; then
include_path=`php -i | grep include_path | awk -F':' '{print $NF}'`
mkdir "$include_path/includes"
install -m 0644 -D -p includes/common.php "$include_path/includes"
install -m 0644 -D -p includes/sql.php "$include_path/includes"
fi
# What version of Samba are you running ?
smbd --version
# For Samba 3.4: #
if [ -x /usr/lib64/samba/vfs/ ]; then cp samba-module/bin/greyhole-x86_64.so /usr/lib64/samba/vfs/greyhole.so; else cp samba-module/bin/greyhole-i386.so /usr/lib/samba/vfs/greyhole.so; fi
# For Samba 3.5: #
if [ -x /usr/lib64/samba/vfs/ ]; then cp samba-module/bin/3.5/greyhole-x86_64.so /usr/lib64/samba/vfs/greyhole.so; else cp samba-module/bin/3.5/greyhole-i386.so /usr/lib/samba/vfs/greyhole.so; fi
Ubuntu (10+): install the Upstart script:
install -m 0644 -D -p upstart.conf /etc/init/greyhole.conf
rm /etc/init.d/greyhole
Fedora: service smb restart
Ubuntu: /etc/init.d/samba restart, or restart smbd
Debian: service samba restart
3. For Samba other than 3.4/3.5/3.6: The greyhole.so files packaged with Greyhole won't work on your system.
You'll need to compile your own VFS module. You'll just need to compile vfs_greyhole.c, and install it.
Note: if, for some reason, you need to compile the VFS module with Samba 3.4 or 3.6, you'll need to use the proper version number in the cp and patch commands below.
For example, for Samba 3.6:
cp ${GREYHOLE_INSTALL_DIR}/samba-module/vfs_greyhole-samba-3.6.c modules/vfs_greyhole.c
patch -p1 < ${GREYHOLE_INSTALL_DIR}/samba-module/Makefile-samba-3.6.patch
Fedora:
yumdownloader --source samba
rpm -ivh samba-3.*.fc*.src.rpm
cd rpmbuild/SOURCES
tar zxf samba-3.*.tar.gz
cd samba-3.*/source3/
Ubuntu:
SAMBA_VERSION=`smbd --version | awk '{print $2}'`
wget http://samba.org/samba/ftp/stable/samba-${SAMBA_VERSION}.tar.gz
tar zxf samba-${SAMBA_VERSION}.tar.gz && rm samba-${SAMBA_VERSION}.tar.gz
cd samba-${SAMBA_VERSION}/source3
Both (Fedora & Ubuntu):
./configure
cp ${GREYHOLE_INSTALL_DIR}/samba-module/vfs_greyhole-samba-3.5.c modules/vfs_greyhole.c
patch -p1 < ${GREYHOLE_INSTALL_DIR}/samba-module/Makefile-samba-3.5.patch
make
if [ -x /usr/lib64/samba/vfs/ ]; then cp bin/greyhole.so /usr/lib64/samba/vfs/greyhole.so; fi
if [ -x /usr/lib/samba/vfs/ ]; then cp bin/greyhole.so /usr/lib/samba/vfs/greyhole.so; fi
Fedora: service smb restart
Ubuntu (< 10): /etc/init.d/samba restart
Ubuntu (10+): restart smbd
Debian: service samba restart
4. Add Greyhole to services that start on boot:
Fedora: chkconfig --add greyhole; chkconfig greyhole on
Ubuntu (< 10): update-rc.d greyhole defaults 98 20
Ubuntu (10+): [nothing to do]
Debian: update-rc.d greyhole defaults
5. Work around problems with the CIFS client (as root):
Ref: http://blog.dhampir.no/content/cifs-vfs-no-response-for-cmd-n-mid
Note: The cron.d script added above includes an @reboot cron line to make this permanent.
modprobe cifs
echo 0 > /proc/fs/cifs/OplockEnabled
You are now ready to configure and use Greyhole.
See the USAGE file for details:
/usr/share/greyhole/USAGE
or online https://raw.github.com/gboudreau/Greyhole/master/USAGE
Jump to Line
Something went wrong with that request. Please try again.