This repository has been archived by the owner on Mar 22, 2021. It is now read-only.
forked from gboudreau/Greyhole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
123 lines (99 loc) · 7.19 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
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 php-pear rsync lsof
Ubuntu: apt-get -y install mysql-server php5-cli php5-mysql php5-mysqlnd php5-intl samba samba-common samba-common-bin php-pear rsync lsof sysstat
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 ?
SMB_VERSION="`smbd --version | awk '{print $2}' | awk -F'-' '{print $1}' | awk -F'.' '{print $1,$2}'`"
echo "You appear to be running Samba $SMB_VERSION"
# For Samba 3.4: #
if [ -x /usr/lib64/samba/vfs/ ]; then ln -s samba-module/bin/3.4/greyhole-x86_64.so /usr/lib64/samba/vfs/greyhole.so; else ln -s samba-module/bin/3.4/greyhole-i386.so /usr/lib/samba/vfs/greyhole.so; fi
# For Samba 3.5: #
if [ -x /usr/lib64/samba/vfs/ ]; then ln -s samba-module/bin/3.5/greyhole-x86_64.so /usr/lib64/samba/vfs/greyhole.so; else ln -s samba-module/bin/3.5/greyhole-i386.so /usr/lib/samba/vfs/greyhole.so; fi
# For Samba 3.6: #
if [ -x /usr/lib64/samba/vfs/ ]; then ln -s samba-module/bin/3.6/greyhole-x86_64.so /usr/lib64/samba/vfs/greyhole.so; else ln -s samba-module/bin/3.6/greyhole-i386.so /usr/lib/samba/vfs/greyhole.so; fi
# For Samba 4.0: #
if [ -d /usr/lib/x86_64-linux-gnu/samba/vfs/ ]; then ln -s samba-module/bin/4.0/greyhole-x86_64.so /usr/lib/x86_64-linux-gnu/samba/vfs/greyhole.so; elif [ -x /usr/lib64/samba/vfs/ ]; then ln -s samba-module/bin/4.0/greyhole-x86_64.so /usr/lib64/samba/vfs/greyhole.so; else ln -s samba-module/bin/4.0/greyhole-i386.so /usr/lib/samba/vfs/greyhole.so; fi
# For Samba 4.1: #
if [ -d /usr/lib/x86_64-linux-gnu/samba/vfs/ ]; then ln -s samba-module/bin/4.1/greyhole-x86_64.so /usr/lib/x86_64-linux-gnu/samba/vfs/greyhole.so; elif [ -x /usr/lib64/samba/vfs/ ]; then ln -s samba-module/bin/4.1/greyhole-x86_64.so /usr/lib64/samba/vfs/greyhole.so; else echo "Sorry, but we don't have a Samba VFS module that you can use"; 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 >4.1: 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.
The following is for Samba 4.x. For Samba 3, see a previous version of this file: https://github.com/gboudreau/Greyhole/blob/0.9.35/INSTALL
Fedora: yum -y install patch gcc python-devel
Ubuntu: apt-get -y install build-essential python-dev
SAMBA_VERSION=4.0.7 # Or whatever is the latest version of Samba4.
wget http://samba.org/samba/ftp/stable/samba-${SAMBA_VERSION}.tar.gz
tar zxf samba-${SAMBA_VERSION}.tar.gz && rm -f samba-${SAMBA_VERSION}.tar.gz
cd samba-${SAMBA_VERSION}
cp ${GREYHOLE_INSTALL_DIR}/samba-module/vfs_greyhole-samba-4.0.c source3/modules/vfs_greyhole.c
patch -p1 < ${GREYHOLE_INSTALL_DIR}/samba-module/wscript-samba-4.0.patch
./configure --enable-debug --enable-selftest --disable-symbol-versions && make
# Create a symlink in the Samba VFS modules dir pointing to the compiled VFS
if [ -d /usr/lib/x86_64-linux-gnu ]; then LIBDIR=/usr/lib/x86_64-linux-gnu; elif [ "`uname -m`" = "x86_64" ]; then LIBDIR=/usr/lib64; else LIBDIR=/usr/lib; fi
ln -s bin/default/source3/modules/libvfs-greyhole.so ${LIBDIR}/samba/vfs/greyhole.so
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.
if [ -f /proc/fs/cifs/OplockEnabled ]; then
modprobe cifs
echo 0 > /proc/fs/cifs/OplockEnabled
fi
if [ -f /sys/module/cifs/parameters/enable_oplocks ]; then
modprobe cifs enable_oplocks=0
echo 0 > /sys/module/cifs/parameters/enable_oplocks
fi
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