Quote:
|
Originally Posted by abhi2778
Hello
I have created customised installation cd .Now I want to install mailserver using post-install script . I have created directory postcon ,which contains my rpms and tarballs and files which i want to copy in system .
I keep my postcon in Buildinstall tree /RH/ONE_CD
MY POST-INSTALL SCRIPT IS ;
%post --nochroot
# cdrom is not mounted during post
mkdir -p /mnt/postconfig
mount /tmp/cdrom /mnt/postconfig
# copy our postconfig to the installed system
cp -rf /mnt/postconfig/postcon /mnt/sysimage/tmp/
%post
echo "Now performing post-KickStart installation tasks"
echo "This is Brisk Mail Server install"
# Install Mail scanner
cd /tmp/postcon
tar -zxvf MailScanner-4.52.2-1.rpm.tar.gz
cd /tmp/postcon/MailScanner-4.52.2-1
./install.sh
#Install F-prot Antivirus
cd /tmp/postcon
rpm -ivh fp-linux-ws.rpm
# Install DBD-Mysql
cd /tmp/postcon
tar -zxvf DBD-mysql-2.1028.tar.gz
cd /tmp/postcon/DBD-mysql-2.1028
perl Makefile.PL
make
make install
# Install Mailwatch
cd /etc
cp php.ini php.ini.abhi
cp /tmp/postcon/php.ini /etc
cd /tmp/postcon
tar -zxvf mailwatch-0.5.1.tar.gz
cd /tmp/postcon/mailwatch
service httpd restart
service mysqld start
mysql < create.sql
service mysqld start
mysql
sleep 10
CMD="GRANT ALL ON mailscanner.* TO mailwatch@localhost IDENTIFIED BY 'password';"
cd /tmp/postcon/mailwatch
cp /tmp/postcon/mailwatch/MailWatch.pm MailWatch.pm.abhi
cp /tmp/postcon/MailWatch.pm /tmp/postcon/mailwatch
cp /tmp/postcon/mailwatch/MailWatch.pm /usr/lib/MailScanner/MailScanner
cd /usr/lib/MailScanner/MailScanner
cp CustomConfig.pm CustomConfig.pm.abhi
cp /tmp/postcon/CustomConfig.pm /usr/lib/MailScanner/MailScanner
#Create a MailWatch web user
mysql mailscanner -u mailwatch -p
# Enter password: ****** (GRANT ALL Password)
sleep 10
CMD="INSERT INTO users VALUES ('admin',md5('password'),'<name>','A');"
#Copy the mailscanner directory to the web server's root
cp -r /tmp/postcon/mailwatch/mailscanner /var/www/html/
cd /var/www/html/mailscanner
chown root:apache images
chmod ug+rwx images
mkdir -p images/cache
chown root:apache images/cache
chmod ug+rwx images/cache
cp /tmp/postcon/conf.php /var/www/html/mailscanner
service MailScanner stop
cp /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.abhi
cp /tmp/postcon/MailScanner.conf /etc/MailScanner/
service MailScanner start
cp -f /tmp/postcon/mailwatch/mailq.php /usr/local/bin/
echo "0-59 * * * * /usr/local/bin/mailq.php" >> /etc/crontab
#Setup the Sendmail Relay Log watcher (optional)
cd /tmp/postcon/mailwatch/tools/
cp /tmp/postcon/mailwatch/tools/sendmail_relay.php /usr/local/bin
echo "nohup /usr/local/bin/sendmail_relay.php 2>&1 > /dev/null &" >> /etc/rc.local
cp /tmp/postcon/mailwatch/fix_quarantine_permissions /usr/local/bin/
echo "*/5 * * * * root /usr/local/bin/fix_quarantine_permissions" >> /etc/crontab
service crond restart
# configure Sendmail
cd /etc/mail/
cp sendmail.mc sendmail.mc.abhi
cp /tmp/postcon/sendmail.mc /etc/mail/
/usr/bin/m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
echo "brisk-india.com" >> /etc/mail/local-host-names
echo "192.168.0 RELAY" >> /etc/mail/access
# update access database
/usr/sbin/makemap hash /etc/mail/access.db < /etc/mail/access
service sendmail restart
#Install Openwebmail for frontend
cd /tmp/postcon
rpm -ivh perl-Text-Iconv-1.2-fc1.i386.rpm
rpm -ivh perl-Text-Iconv-1.2-fc1.i386.rpm
rpm -ivh openwebmail-2.41-1.i386.rpm
cat /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf | sed -e 's/dbm_ext .db/dbm_ext .db/' > /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf
cat /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf | sed -e 's/dbmopen_ext no/dbmopen_ext .db/' > /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf
cat /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf | sed -e 's/dbmopen_haslock no/dbmopen_haslock yes/' > /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf
#Execute this line
/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init
cp /etc/dovecot.conf /etc/dovecot.conf.abhi
cp /tmp/postcon/dovecot.conf /etc
# create file /sbin/mlog
cp /tmp/postcon/mlog /sbin
cp /tmp/postcon/seemail /sbin
cp /tmp/postcon/getmail /sbin
cp /tmp/postcon/.fetchmail.rc /root
echo "iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward" >> /etc/rc.local
cp /tmp/postcon/firewall /sbin/
cd /tmp/postcon
rpm -ivh webmin-1.150-1.noarch.rpm
Please help me out of this hole
Free to give any suggestions.
|
Hello ,I 'm a newbie Linux and i'm trying to use Xen and Linux together.
I'm facing few problens with %post in kickstart in FC5.
1)Copying of files during post is failing inspite of having Static IP.(resolv.conf must have been ready).
2)Other than /usr/share/doc/anaconda-11.1.1.3/kickstart-docs.txt file,
Could you suggest some documents which could tell me
"how flexible is %post and what all are the thigns we can do with it"
3)Also i'm a little confused about the state of the file system when anaconda is running %post.Could you shed some light on that and what things like /mnt/sysimage corresponds to?
will be eternally grateful
Thanks.