Modifications to use the new mmlimitrate(3) API
[mmondor.git] / mmsoftware / mmstatd / install.sh
CommitLineData
5eb34fba 1#!/bin/sh
da634739 2# $Id: install.sh,v 1.6 2003/10/23 01:01:32 mmondor Exp $
5eb34fba
MM
3
4if [ "$1" = "help" ]; then
5 echo
6 echo 'You can optionally set the following environment variables'
7 echo 'to customize the installation process. For each is shown an'
8 echo 'example using the default value followed by a breif description.'
9 echo
1a5bbe01
MM
10 echo 'export MMLAUNCH="TRUE"'
11 echo ' Tells the install process to immediately launch the daemon(s)'
12 echo ' They are automatically killed before the binaries are copied'
13 echo ' over the old ones as is necessary with some systems. The'
14 echo ' default is to not start them back automatically.'
5eb34fba
MM
15 echo
16 echo 'export MMPREFIX="/usr/local"'
17 echo ' Allows to set the installation base directory. All files but'
18 echo ' configuration ones will be installed in directories relative'
19 echo ' to this one.'
20 echo
21 echo 'export MMCONFDIR="/etc"'
22 echo ' Directory in which configuration files should be stored.'
23 echo
24 echo 'export MMDEFAULTUSER="0"'
25 echo ' User new files and directories should be owned by, using'
26 echo ' user id or name.'
27 echo
28 echo 'export MMDEFAULTGROUP="0"'
29 echo ' Group new files and directories should be under, using id'
30 echo ' or name.'
31 echo
32 echo 'export MMADMINGROUP="staff"'
33 echo ' The administrators group, these can for instance view and the'
34 echo ' rotate mmstat statistics and execute mmpasswd. Will be'
35 echo ' created automatically if necessary.'
36 echo
37 echo 'export MMSTATDIR="/var/mmstatd"'
38 echo ' The directory in which mmstatd will store the stats database'
39 echo ' and log files.'
40 echo
41 echo 'export MMSTATDUSER="mmstatd"'
42 echo ' The user mmstatd will run under, to be automatically created.'
43 echo
44 echo 'export MMSTATDGROUP="mmstat"'
45 echo ' Group the mmstatd user should be part of, automatically'
46 echo ' created.'
47 echo
48 exit
49fi
50
51# Set defaults if not set
52if [ -z "$MMLAUNCH" ]; then
1a5bbe01 53 export MMLAUNCH='FALSE'
5eb34fba
MM
54fi
55if [ -z "$MMPREFIX" ]; then
56 export MMPREFIX='/usr/local'
57fi
58if [ -z "$MMCONFDIR" ]; then
59 export MMCONFDIR='/etc'
60fi
61if [ -z "$MMDEFAULTUSER" ]; then
62 export MMDEFAULTUSER='0'
63fi
64if [ -z "$MMDEFAULTGROUP" ]; then
65 export MMDEFAULTGROUP='0'
66fi
67if [ -z "$MMADMINGROUP" ]; then
68 export MMADMINGROUP='staff'
69fi
70if [ -z "$MMSTATDIR" ]; then
71 export MMSTATDIR='/var/mmstatd'
72fi
73if [ -z "$MMSTATDUSER" ]; then
74 export MMSTATDUSER='mmstatd'
75fi
76if [ -z "$MMSTATDGROUP" ]; then
77 export MMSTATDGROUP='mmstat'
78fi
79
80. ../mmlib/makefuncs.sh
81
82instgroup $MMADMINGROUP
83
84cd ../mmlib/
85instman mmlist.3 3
7a56f31f 86instman mmpool.3 3
5eb34fba 87instman mmstat.3 3
904cd663 88instman mmhash.3 3
5eb34fba 89cd ../
b687a849
MM
90cd apache-mmstat/
91instman apache-mmstat.8 8
92cd ../
5eb34fba
MM
93
94cd mmstatd/src/
95instuser $MMSTATDUSER $MMSTATDGROUP
96killbin mmstatd
97instbin mmstatd 700
98instbin mmstat 750 $MMADMINGROUP
99instman mmstat.8 8
100instman mmstatd.8 8
101instman mmstatd.conf.5 5
da634739
MM
102instman mmlist.3 3
103instman mmpool.3 3
104instman mmhash.3 3
105instman mmlimitrate.3 3
5eb34fba
MM
106cd ../etc/
107instconf mmstatd.conf 640 $MMSTATDGROUP
108instdir $MMSTATDIR 750 $MMSTATDUSER $MMSTATDGROUP
109if [ "$MMLAUNCH" = "TRUE" ]; then
110 startbin mmstatd $MMCONFDIR/mmstatd.conf
111fi
112cd ../../
b687a849
MM
113cd apache-mmstat/
114instbin apache-mmstat 700
5eb34fba
MM
115
116echo
117echo "*** Please read the following man pages ***"
118echo
b687a849 119echo "mmstat(8), mmstatd(8), mmstatd.conf(5), apache-mmstat(8)"
da634739
MM
120echo "source auditors: mmstat(3), mmlist(3), mmpool(3), mmhash(3),"
121echo " mmlimitrate(3)"
5eb34fba
MM
122echo
123echo "Thank you for using mmsoftware."
124echo