summaryrefslogtreecommitdiff
path: root/network/lizardfs/setup.lizardfs-services.new
blob: c9b1e6c2f9af60d1ad019fb72e3c3616d934faee (plain)
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
#!/bin/sh
#BLURB="Select/deselect LizardFS services"
#
# /var/log/setup/setup.lizardfs-services
#
# LizardFS configuration script.  Lets you choose which of four
# it's processes will run on this box.
#
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]; then
	mkdir -p $TMP
fi
T_PX="$1"
cd $T_PX
rm -f $TMP/tmpscript

cat << EOF > $TMP/tmpscript
dialog --title "CHOOSE LizardFS SERVICES TO RUN ON THIS BOX" --item-help --checklist \\
"The selected services will be started by rc.lizardfs init script.\\n\\n
1. You need exactly ONE master server (run on your best machine)\\n
2. You should have one, two or more meta loggers\\n
3. On most machines you will need chunk server process only \\
(therefore rc.lizardfs-chunkserver is enabled by default.\\n\\n
Press the ENTER key when you are finished." \\
19 70 4 \\
EOF

if [ -r /etc/rc.d/rc.lizardfs-master ]; then
	if [ -x /etc/rc.d/rc.lizardfs-master ]; then
		MFS_MASTER=on
	else
		MFS_MASTER=off
	fi
	cat << EOF >> $TMP/tmpscript
		"rc.lizardfs-master" "LizardFS master server" $MFS_MASTER "The Master Server is a central point of LizardFS.  You need exactly ONE." \\
EOF
fi

if [ -r /etc/rc.d/rc.lizardfs-cgiserv ]; then
	if [ -x /etc/rc.d/rc.lizardfs-cgiserv ]; then
		MFS_CGI=on
	else
		MFS_CGI=off
	fi
	cat << EOF >> $TMP/tmpscript
		"rc.lizardfs-cgiserv" "LizardFS Web Console" $MFS_CGI "The CGI server displays information on LizardFS status." \\
EOF
fi

if [ -r /etc/rc.d/rc.lizardfs-metalogger ]; then
	if [ -x /etc/rc.d/rc.lizardfs-metalogger ]; then
		MFS_METALOGGER=on
	else
		MFS_METALOGGER=off
	fi
	cat << EOF >> $TMP/tmpscript
		"rc.lizardfs-metalogger" "Metalogger process" $MFS_METALOGGER "Metalogger is a backup machine for Master Server.  Deploy some in your network." \\
EOF
fi

if [ -r /etc/rc.d/rc.lizardfs-chunkserver ]; then
	if [ -x /etc/rc.d/rc.lizardfs-chunkserver ]; then
		MFS_CHUNK=on
	else
		MFS_CHUNK=off
	fi
	cat << EOF >> $TMP/tmpscript
		"rc.lizardfs-chunkserver" "Chunk server process" $MFS_CHUNK "The Chunk Server stores actual filesystem data in chunks.  All other machines." \\
EOF
fi

cat << EOF >> $TMP/tmpscript
	2> $TMP/reply
EOF

. $TMP/tmpscript

if [ ! $? = 0 ]; then
	rm -f $TMP/reply $TMP/tmpscript
	exit
fi

for service in rc.lizardfs-cgiserv rc.lizardfs-chunkserver rc.lizardfs-master rc.lizardfs-metalogger; do
	if [ -f /etc/rc.d/$service ]; then
		if grep -w $service $TMP/reply 1> /dev/null ; then
			chmod 755 /etc/rc.d/$service
		else
			chmod 644 /etc/rc.d/$service
		fi
	fi
done

rm -f $TMP/reply $TMP/tmpscript