2
# Configuration script for sysstat
3
# (C) 2000-2004 Sebastien GODARD (sysstat <at> wanadoo.fr)
8
echo You can enter a ? to display a help message at any time...
11
# Installation directory
13
PREFIX=`${ASK} 'Installation directory:' "/usr/local" "prefix"`
14
if [ ! -d ${PREFIX} ]; then
15
echo "WARNING: Directory ${PREFIX} not found: Using default (/usr/local)."
19
# System Activity directory
21
SA_DIR=`${ASK} 'System activity directory:' "/var/log/sa" "sa-dir"`
22
if [ ! -d ${SA_DIR} ]; then
23
echo "INFO: Directory ${SA_DIR} will be created during installation stage."
26
CLEAN_SA_DIR=`${ASK} 'Clean system activity directory?' "n" "clean-sa-dir"`
28
# National Language Support
29
NLS=`${ASK} 'Enable National Language Support (NLS)?' "y" "nls"`
30
which msgfmt > /dev/null 2>&1
32
if [ "${NLS}" = "y" -a ${WHICH} -eq 1 ]; then
33
echo WARNING: msgfmt command not found!
36
# Linux SMP race workaround
38
SMPRACE=`${ASK} 'Linux SMP race in serial driver workaround?' "n" "smp-race"`
40
# sa2 processes data file of the day before
42
YESTERDAY=`${ASK} 'sa2 uses daily data file of previous day?' "n" "yesterday"`
43
if [ "${YESTERDAY}" = "y" ];
45
YDAY="--date=yesterday"
50
# Data history to keep by sa2
52
HISTORY=`${ASK} 'Number of daily data files to keep:' "7" "history"`
56
grep ^man: /etc/group >/dev/null 2>&1
63
MAN=`${ASK} 'Group for manual pages:' "${GRP}" "man-group"`
64
grep ^${MAN}: /etc/group >/dev/null 2>&1
67
echo WARNING: Group ${MAN} not found: Using ${GRP} instead.
71
# Set system directories
73
if [ -d /etc/init.d ];
75
if [ -d /etc/init.d/rc2.d ];
84
elif [ -d /sbin/init.d ];
91
INIT_DIR=/etc/rc.d/init.d
97
grep ^adm: /etc/passwd >/dev/null 2>&1
105
CRON=`${ASK} 'Set crontab to start sar automatically?' "n" "start-crontab"`
106
if [ "${CRON}" = "y" ];
108
CRON_OWNER=`${ASK} 'Crontab owner (his crontab will be saved in current directory):' "${USR}" "crontab-owner"`
110
grep ^${CRON_OWNER}: /etc/passwd >/dev/null 2>&1
113
echo WARNING: User ${CRON_OWNER} not found: Using ${USR} instead.
120
if [ -L ${PREFIX}/man -a -d ${PREFIX}/share/man ];
122
MANDIR=${PREFIX}/share/man
128
echo " man directory is ${MANDIR}"
129
echo " rc directory is ${RC_DIR}"
130
echo "init directory is ${INIT_DIR}"
135
echo -n Creating CONFIG file now...
137
sed <build/CONFIG.in >build/CONFIG \
138
-e "s+^\\(PREFIX =\\)\$+\\1 ${PREFIX}+" \
139
-e "s+^\\(SA_DIR =\\)\$+\\1 ${SA_DIR}+" \
140
-e "s+^\\(MAN_DIR =\\)\$+\\1 ${MANDIR}+" \
141
-e "s+^\\(CLEAN_SA_DIR =\\)\$+\\1 ${CLEAN_SA_DIR}+" \
142
-e "s+^\\(ENABLE_NLS =\\)\$+\\1 ${NLS}+" \
143
-e "s+^\\(ENABLE_SMP_WRKARD =\\)\$+\\1 ${SMPRACE}+" \
144
-e "s+^\\(YESTERDAY =\\)\$+\\1 ${YDAY}+" \
145
-e "s+^\\(HISTORY =\\)\$+\\1 ${HISTORY}+" \
146
-e "s+^\\(MAN_GROUP =\\)\$+\\1 ${MAN}+" \
147
-e "s+^\\(RC_DIR =\\)\$+\\1 ${RC_DIR}+" \
148
-e "s+^\\(INIT_DIR =\\)\$+\\1 ${INIT_DIR}+" \
149
-e "s+^\\(INITD_DIR =\\)\$+\\1 ${INITD_DIR}+" \
150
-e "s+^\\(CRON_OWNER =\\)\$+\\1 ${CRON_OWNER}+" \
151
-e "s+^\\(INSTALL_CRON =\\)\$+\\1 ${CRON}+"
155
echo 'Now enter "make" to build sysstat commands.'
156
if [ "${CRON}" = "y" ];
158
echo 'Then edit the crontab file created in current directory ("vi crontab")'
160
echo 'The last step is to log in as root and enter "make install"'
161
echo 'to perform installation process.'