RE: e-mailing from post

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Woops - correction on the mount command:

 mount -o loop /dist/RedHat/base/stage2.img /mnt/stage2

See what happens when you type to fast?!

-----Original Message-----
From: Lynn, Michael (IDS DM&DS) [mailto:MLynn@xxxxxxxxxxxxxxx] 
Sent: Thursday, March 20, 2003 10:17 AM
To: 'kickstart-list@xxxxxxxxxx'
Subject: RE: e-mailing from post


I don't believe the mail command is available in post.

You can checkout the available commands by mounting stage2.img

 mkdir /mnt/stage2
 mount /dist/RedHat/base/stage2.img
 find /mnt/stage2 -perm 555 # or whatever

We accomplish this sort of thing in a post install phase - after the server's install is complete and after a reboot.

This is done with a runonce script that is executed on the first reboot after the build.

To do this, simply create the script you want to execute in post:


%post
touch /runonce1.sh
cat <<EOF>>/etc/rc.d/rc.local
#

if [ -x /runonce1.sh ]
then
        sh /runonce1.sh
        rm /runonce1.sh
        sleep 10
        echo
        echo "##########################################"
        echo "#PHASE 2 OF THE INSTALLATION IS COMPLETE"
        echo "##########################################"
        echo "#NOW REBOOTING INTO FINAL PHASE"
        echo "##########################################"
        echo
        sleep 10
        reboot
fi
EOF

cat <<EOF>>/runonce1.sh
/sbin/mail myemail@xxxxxxxxxxx < /root/kickstart-post.log

EOF


While this might be overkill for simply sending a mail - it does give you the freedom to do things like... Re-mount the installation source and perform upgrades, install new packages, etc... We use it
to upgrade the kernel, reboot and then install a mess of isv packages that require a specific version of the kernel.

Good luck.

Oh... Btw: fix your sig - you've mispeeled United States. ;-)


-----Original Message-----
From: James_Martin@xxxxxxxxxxxxxxx [mailto:James_Martin@xxxxxxxxxxxxxxx] 
Sent: Thursday, March 20, 2003 9:36 AM
To: kickstart-list@xxxxxxxxxx
Subject: e-mailing from post


I want to send an email in the %post section notifying me of when a build is complete..  The email consists of a log of the %post commands as well as a date stamp.  The following command does not seem
to work from %post, but will work when it is run after the machine is fully installed.

mail myemail@xxxxxxxxxxx < /root/kickstart-post.log

Any ideas?

Thanks.

James S. Martin, RHCE
Contractor
Administrative Office of the United Sates Courts
Washington, DC
(202) 502-2394



_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/kickstart-list



_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/kickstart-list





[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux