LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 09-14-2006, 07:09 AM   #1
abhi2778
LQ Newbie
 
Registered: Jul 2006
Posts: 13

Rep: Reputation: 0
Red face kickstart post-installation


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.
 
Old 09-15-2006, 01:04 AM   #2
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 977

Rep: Reputation: 30
Okay I order to get more in shape with your situation, what works and what doesn't?
 
Old 01-16-2007, 10:04 AM   #3
jape_suyash
LQ Newbie
 
Registered: Jan 2007
Posts: 2

Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
running %post script for Mailserver through kickstart abhi2778 Fedora 0 09-06-2006 03:12 AM
Kickstart installation. Access to cdrom in %post mrcash Fedora - Installation 2 07-21-2005 11:29 AM
Unable to run post-Installation kickstart scripts zoulo Linux - Enterprise 0 07-05-2005 03:26 AM
rh9 kickstart post install help stockcowboy Linux - Newbie 1 12-05-2003 11:45 AM
Kickstart Post-install tasks TheRealDeal Linux - General 0 09-03-2003 01:13 AM


All times are GMT -5. The time now is 12:49 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration