-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathINSTALL
161 lines (103 loc) · 4.61 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
Basic installation:
-----------------------------------------------
Run configure, define glftpd root path:
make clean
./configure --prefix /glroot
Configure will try to copy glconf.h from '$prefix/bin/sources' automatically,
if it fails, find and copy the file to 'src/' folder manually.
Adjust paths and IPC keys if required:
vi src/config.h
At the time of compilation, default log and glroot paths are set based on --prefix
path.
make
make install
Copy scripts (optional):
cp -R scripts/* /glroot/bin/scripts/
Create custom logs data folder (optional):
mkdir -p /glroot/ftp-data/glutil/db
Ensure procfs is mounted in /proc, if not, add the entry to /etc/fstab and/or mount
it manually:
mount -t procfs proc /proc
On some platforms -t procfs won't work, try:
mount -t proc proc /proc
Setup glutil for use in a chrooted environment:
------------------------------------------------
Clean previous build and compile:
make clean
./configure --prefix /glroot --enable-chroot-ownbin
make
make install
'glutil-chroot' is installed in /glroot/bin with all log paths and glroot
aligned to '/'.
Set up prerequisites:
Create and chmod /tmp in /glroot, if not already:
mkdir /glroot/tmp
chmod 1777 /glroot/tmp
Mount procfs:
mount -t procfs proc /glroot/proc
Set permissions to log files:
touch /glroot/ftp-data/logs/glutil.log (if logging enabled)
chmod 666 /glroot/ftp-data/logs/glutil.log (if logging enabled)
chmod 666 /glroot/ftp-data/logs/glftpd.log (if using any scripts that need to write here)
...
Precheck installation:
------------------------------------------------
Clean previous build and compile:
make clean
./configure --prefix /glroot --enable-precheck
make
make install
Copy sample config files:
mkdir -p /glroot/ftp-data/glutil/precheck-config/
cp ftp-data/glutil/precheck-config/* /glroot/ftp-data/glutil/precheck-config/
Read the configuration files:
/glroot/ftp-data/glutil/precheck-config/gconf (global config)
/glroot/ftp-data/glutil/precheck-config/example (per section config)
'glutil-precheck' is installed in /glroot/bin with all log paths and glroot
aligned to '/'.
Precheck uses imdb/tvrage logs. Configurable hooks are available, used
for calling lookup scripts and delayed nukes when data is not available
locally. (read ftp-data/glutil/precheck-config/gconf)
Ensure the log storage path and data is read/write for everyone:
chmod 777 /glroot/ftp-data/glutil/db
chmod 666 /glroot/ftp-data/glutil/db/tvrage
chmod 666 /glroot/ftp-data/glutil/db/imdb
If the files/paths don't exist, create them first.
Install tvrage_get.sh and imdb_get.sh in /bin/scripts and configure them
for log lookups. Ensure lookups are working properly in the normal
environment.
Run '*-installch' macros to attempt installing required libs automatically:
glutil -m tvrage-installch
glutil -m imdb-installch
Find and copy libnss_files.so.2 libnss_dns.so.2 to /usr or /usr64 dir
(not always required, do this if the scripts can't resolve DNS records)
There's a full list of dependencies inside each script.
If you plan on using the shared memory cache option, there are limits on how
big a segment can be and how much shared memory can be allocated.
Set the limits high enough to accommodate the log + some reserve:
sysctl -w kernel.shmall=<bytes> - global shared mem max size
sysctl -w kernel.shmmax=<bytes> - single segment max size
Save options in /etc/sysctl.conf so they persist on reboot.
glftpd.conf:
pre_dir_check /bin/glutil-precheck
Ensure that the global configuration files are loaded into the shared
memory segment at boot time:
/etc/rc.local (or any boot exec method of your choosing):
/glftpd/bin/scripts/precheck_compile.sh
Time to test it out:
At this point, you can pre-build a glutil binary that is aligned to the
chrooted environment (see above), or use command line path options to
test if lookups/log writes work.
chroot /glroot
Avoid testing as root, any user needs to have write access to logs.
/bin/glutil -m imdb-e -arg1 "Some Movie"
Dynamic paths:
/bin/glutil -m imdb-e -arg1 "Some Movie" --imdblog /ftp-data/glutil/db/imdb --glroot /
Look for the new record:
/bin/glutil -q imdb --rev --maxres=5
If it's there (and you were doing this as a regular user), all should be well.
Other precheck scripts/tools can be included as parts of an existing chain.
Look in examples (/ftp-data/glutil/precheck-confg/) to see how.
If you've already got a set of yourown precheck scripts to which you are used
to, there's no need to dismiss them, rather stack their filtering tasks using
glutil's engine, forming a powerfull filter chain.