38f8b02d48a187e784a1c1e0ac542d56e99a19b7
[mmondor.git] / mmsoftware / mmstatd / install.sh
1 #!/bin/sh
2 # $Id: install.sh,v 1.5 2003/07/02 17:20:57 mmondor Exp $
3
4 if [ "$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
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.'
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
49 fi
50
51 # Set defaults if not set
52 if [ -z "$MMLAUNCH" ]; then
53 export MMLAUNCH='FALSE'
54 fi
55 if [ -z "$MMPREFIX" ]; then
56 export MMPREFIX='/usr/local'
57 fi
58 if [ -z "$MMCONFDIR" ]; then
59 export MMCONFDIR='/etc'
60 fi
61 if [ -z "$MMDEFAULTUSER" ]; then
62 export MMDEFAULTUSER='0'
63 fi
64 if [ -z "$MMDEFAULTGROUP" ]; then
65 export MMDEFAULTGROUP='0'
66 fi
67 if [ -z "$MMADMINGROUP" ]; then
68 export MMADMINGROUP='staff'
69 fi
70 if [ -z "$MMSTATDIR" ]; then
71 export MMSTATDIR='/var/mmstatd'
72 fi
73 if [ -z "$MMSTATDUSER" ]; then
74 export MMSTATDUSER='mmstatd'
75 fi
76 if [ -z "$MMSTATDGROUP" ]; then
77 export MMSTATDGROUP='mmstat'
78 fi
79
80 . ../mmlib/makefuncs.sh
81
82 instgroup $MMADMINGROUP
83
84 cd ../mmlib/
85 instman mmlist.3 3
86 instman mmpool.3 3
87 instman mmstat.3 3
88 instman mmhash.3 3
89 cd ../
90 cd apache-mmstat/
91 instman apache-mmstat.8 8
92 cd ../
93
94 cd mmstatd/src/
95 instuser $MMSTATDUSER $MMSTATDGROUP
96 killbin mmstatd
97 instbin mmstatd 700
98 instbin mmstat 750 $MMADMINGROUP
99 instman mmstat.8 8
100 instman mmstatd.8 8
101 instman mmstatd.conf.5 5
102 cd ../etc/
103 instconf mmstatd.conf 640 $MMSTATDGROUP
104 instdir $MMSTATDIR 750 $MMSTATDUSER $MMSTATDGROUP
105 if [ "$MMLAUNCH" = "TRUE" ]; then
106 startbin mmstatd $MMCONFDIR/mmstatd.conf
107 fi
108 cd ../../
109 cd apache-mmstat/
110 instbin apache-mmstat 700
111
112 echo
113 echo "*** Please read the following man pages ***"
114 echo
115 echo "mmstat(8), mmstatd(8), mmstatd.conf(5), apache-mmstat(8)"
116 echo "source auditors: mmstat(3), mmlist(3), mmpool(3), mmhash(3)"
117 echo
118 echo "Thank you for using mmsoftware."
119 echo