#!/bin/bash if [ ! "$USER" = "root" ]; then echo "user is not root, aborting." exit 1 fi if [ ! `pwd` = "/home/amanda/amandasrc" ]; then echo "you must first cd to /home/amanda/amandasrc" exit 1 fi TRUE=0 FALSE=1 if [ `hostname` = "dimanche" ]; then isServer=$TRUE else isServer=$FALSE fi set -x if [ ! -e /home/amanda ]; then echo "There must be a user \"amanda\" who is a member of groups \"disk\" and \"tape\", and whose home is /home/amanda" exit 1 fi usermod -G amanda,disk,tape amanda if [ -d /home/amanda/DailySet1 ]; then rm -rf /home/amanda/DailySet1 fi if [ "$isServer" = "$TRUE" ]; then if [ ! -d /home/amanda/INDEX ]; then mkdir -p /home/amanda/INDEX fi if [ ! -d /home/amanda/INFO ]; then mkdir -p /home/amanda/INFO fi if [ ! -d /home/amanda/LOG ]; then mkdir -p /home/amanda/LOG fi fi if [ ! -e /tmp/amanda ]; then mkdir /tmp/amanda fi chown -R amanda.disk /tmp/amanda if [ -e /home/amanda/coolheads ]; then rm -rf /home/amanda/coolheads fi mkdir /home/amanda/coolheads ln -s /home/amanda/amandasrc/coolheads/.amandahosts /home/amanda/.amandahosts ln -s /home/amanda/amandasrc/coolheads/.amandahosts /home/amanda/coolheads/.amandahosts ln -s /home/amanda/amandasrc/coolheads/amanda.conf /home/amanda/amanda.conf ln -s /home/amanda/amandasrc/coolheads/amanda.conf /home/amanda/coolheads/amanda.conf ln -s /home/amanda/amandasrc/coolheads/amanda-client.conf /home/amanda/amanda-client.conf ln -s /home/amanda/amandasrc/coolheads/amanda-client.conf /home/amanda/coolheads/amanda-client.conf ln -s /home/amanda/amandasrc/coolheads/tapelist /home/amanda/tapelist ln -s /home/amanda/amandasrc/coolheads/tapelist /home/amanda/coolheads/tapelist ln -s /home/amanda/amandasrc/coolheads/disklist /home/amanda/disklist ln -s /home/amanda/amandasrc/coolheads/disklist /home/amanda/coolheads/disklist ln -s /home/amanda/amandasrc/coolheads/chg-multi.conf /home/amanda/coolheads/chg-multi.conf whereWeWere=`pwd` cd /home/amanda/amandasrc/coolheads for i in *-excludes ; do ln -s /home/amanda/amandasrc/coolheads/${i} /home/amanda/coolheads/${i} done if [ ! -e /home/amanda/share ]; then mkdir /home/amanda/share fi if [ ! -e /home/amanda/man ]; then mkdir /home/amanda/man fi if [ -e /home/amanda/lib ]; then rm -rf /home/amanda/lib fi if [ -e /home/amanda/libexec ]; then rm -rf /home/amanda/libexec fi if [ -e /home/amanda/man ]; then rm -rf /home/amanda/man fi if [ -e /home/amanda/sbin ]; then rm -rf /home/amanda/sbin fi if [ -e /home/amanda/share ]; then rm -rf /home/amanda/share fi if [ -e /home/amanda/amandasrc/amanda-2.5.1 ]; then rm -rf /home/amanda/amandasrc/amanda-2.5.1 fi cd /home/amanda/amandasrc tar xzf amanda-2.5.1.tar.gz cd /home/amanda/amandasrc/amanda-2.5.1 commonConfigArgs=\ " --prefix=/home/amanda \ --exec-prefix=/home/amanda \ --sysconfdir=/home/amanda \ --datadir=/home/amanda/share \ --sysconfdir=/home \ --sharedstatedir=/home/amanda/com \ --localstatedir=/home/amanda/var \ --libdir=/home/amanda/lib \ --includedir=/home/amanda/include \ --oldincludedir=/home/amanda/include \ --mandir=/home/amanda/man \ --infodir=/home/amanda/info --with-user=amanda \ --with-group=disk \ --with-ssh-security" set - $commonConfigArgs if [ "$isServer" = "$TRUE" ]; then echo ./configure $@ ./configure $@ else echo ./configure $@ --without-server ./configure $@ --without-server fi make make install if [ "$isServer" = "$TRUE" ]; then if [ ! -e /nobackup/AMANDASPOOL ]; then mkdir /nobackup/AMANDASPOOL fi chown -R root.disk /nobackup/AMANDASPOOL fi if [ ! -d /home/amanda/var ]; then mkdir /home/amanda/var fi if [ ! -d /home/amanda/var/gnutar_list ]; then mkdir /home/amanda/var/gnutar_list fi if [ ! -e /home/amanda/var/amandates ]; then touch /home/amanda/var/amandates fi if [ ! -f /home/amanda/amandasrc/coolheads/tapelist ]; then touch /home/amanda/amandasrc/coolheads/tapelist fi ### Bug: if the below line is: ### chown -R root.disk /home/amanda ### then, when Amanda creates the ### the holding disk (/nobackup/AMANDASPOOL/200609...) ### directory for the dump, it's created with root ### ownership and mode 700 permissions, and Amanda ### can't write on it. I have no idea why this happens. ### The Amanda code says it's creating this directory ### with 770 permissions. --SRN chown -R amanda.disk /home/amanda chown root.disk /home/amanda/libexec/runtar chown root.disk /home/amanda/libexec/dumper chown root.disk /home/amanda/libexec/planner chown root.disk /home/amanda/sbin/amcheck chmod -R 6770 /home/amanda/libexec/* /home/amanda/sbin/* if [ -d /home/amanda/DailySet1 ]; then rm -rf /home/amanda/DailySet1 fi cat - <=3.04d # --with-rew-tape deprecated, use --with-tape-device # --with-norew-tape=ARG deprecated, use --with-tape-device # --with-changer-device=ARG default tape changer device [/dev/ch0 if it exists] # --with-fqdn use FQDN's to backup multiple networks # --with-broken-fsf only enable if tape fsf calls fail mid-file # --without-reuseaddr Don't closed network connections to be reused until full timeout period. # --with-gnutar[=PROG] use PROG as GNU tar executable [default: looks for one] # --with-smbclient[=PROG] use PROG as Samba's smbclient executable [default: looks for one] # --with-samba-user was deprecated # --with-gnutar-listdir=DIR gnutar directory lists go in DIR [localstatedir/amanda/gnutar-lists] # --with-gnutar-listed-incremental was deprecated, use --with-gnutar-listdir # --without-bsd-security do not use BSD rsh/rlogin style security # --without-amandahosts use .rhosts instead of .amandahosts # --with-dbmalloc=DIR Location of dbmalloc libs and headers # --with-krb4-security=DIR Location of Kerberos software [/usr/kerberos /usr/cygnus /usr /opt/kerberos] # --with-rsh-security use rsh as a transport # --with-ssh-security use ssh as a transport # --with-bsdtcp-security use tcp as a transport # --with-bsdudp-security use tcp as a transport # --with-server-principal=ARG server host principal ["amanda"] # --with-server-instance=ARG server host instance ["amanda"] # --with-server-keyfile=ARG server host key file ["/.amanda"] # --with-client-principal=ARG client host principal ["rcmd"] # --with-client-instance=ARG client host instance [HOSTNAME_INSTANCE] # --with-client-keyfile=ARG client host key file [KEYFILE] # --with-ticket-lifetime=ARG ticket lifetime [128] # --with-krb5-security=DIR Location of Kerberos V software [/usr/kerberos /usr/cygnus /usr /opt/kerberos] # --with-low-tcpportrange=low,high bind reserved TCP server sockets to ports within this range unlimited (mainly for amrecover) # --with-tcpportrange=low,high bind unreserved TCP server sockets to ports within this range [unlimited] # --with-udpportrange=low,high bind reserved UDP server sockets to ports within this range [unlimited] # --with-maxtapeblocksize=kb Maximum size of a tape block # --with-db={text,db,dbm,gdbm,ndbm} use the selected database format [text] # --with-mmap force use of mmap instead of shared memory support # --with-buffered-dump buffer the dumping sockets on the server for speed # --with-assertions compile assertions into code # --with-tmpdir=/temp/dir area Amanda can use for temp files [/tmp/amanda] # --with[out]-debugging[=/debug/dir] [do not] record runtime debugging information in specified directory [--with-tmpdir] # --with-debug-days=NN number of days to keep debugging files [default=4] # --with-testing[=suffix] use alternate service names # --with-dump-honor-nodump if dump supports -h, use it for level0s too # --with-gnu-ld assume the C compiler uses GNU ld [default=no] # --with-pic try to use only PIC/non-PIC objects [default=use # both] # --with-tags[=TAGS] # include additional configurations [automatic] # --without-built-manpages Do not build manpages from XML source. # # Some influential environment variables: # CC C compiler command # CFLAGS C compiler flags # LDFLAGS linker flags, e.g. -L if you have libraries in a # nonstandard directory # CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have # headers in a nonstandard directory # CPP C preprocessor # CXX C++ compiler command # CXXFLAGS C++ compiler flags # CXXCPP C++ preprocessor # F77 Fortran 77 compiler command # FFLAGS Fortran 77 compiler flags # # Use these variables to override the choices made by `configure' or to help # it to find libraries and programs with nonstandard names/locations. # #