myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2889] trunk/installers: Modded Fedora installer


From: noreply
Subject: [myexperiment-hackers] [2889] trunk/installers: Modded Fedora installer so it works for Fedora 16 and removed references to Mongrel in Ubuntu installer
Date: Wed, 21 Dec 2011 12:48:33 -0500 (EST)

Revision
2889
Author
drn05r
Date
2011-12-21 12:48:32 -0500 (Wed, 21 Dec 2011)

Log Message

Modded Fedora installer so it works for Fedora 16 and removed references to Mongrel in Ubuntu installer

Modified Paths

Diff

Modified: trunk/installers/fedora/install.bash (2888 => 2889)


--- trunk/installers/fedora/install.bash	2011-12-21 11:31:44 UTC (rev 2888)
+++ trunk/installers/fedora/install.bash	2011-12-21 17:48:32 UTC (rev 2889)
@@ -6,11 +6,13 @@
 echo "+----------------------------------------------------------------------------------------------+"
 echo ""
 
-settings_file=`dirname $0`/settings.bash 
-source $settings_file || { echo "Could not find settings file at $settings_file. Aborting ..."; exit 1;}
+d=`dirname $0`
+basedir=`cd ${d}; pwd`
+source ${basedir}/settings.bash || { echo "Could not find settings file at $settings_file. Aborting ..."; exit 1;}
 
-echo "Extending timeout for sudo commands in /etc/sudoers"
-echo "Defaults     timestamp_timeout = 3600" | sudo tee -a /etc/sudoers > /dev/null || { echo "Failed to disable sudo prompt timeout. Aborting ..."; exit 2; }
+echo "Extending timeout for sudo commands in /etc/sudoers.d/default_timeout"
+echo "Defaults     timestamp_timeout = 3600" | sudo tee -a /etc/sudoers.d/default_timeout > /dev/null || { echo "Failed to disable sudo prompt timeout. Aborting ..."; exit 2; }
+sudo chmod 440 /etc/sudoers.d/default_timeout || { echo "Failed to chmod /etc/sudoers.d/default_timeout. Aborting ..."; exit 70; }
 
 echo "Installing required Yum packages"
 sudo yum update || { echo "Failed to update apt-get. Aborting ..."; exit 3; }
@@ -28,11 +30,11 @@
 sudo chkconfig sendmail on || { echo "Failed to MySQL to applications started at boottime. Aborting ..."; exit 11; }
 sudo cp /etc/hosts ${tempdir}/ || { echo "Failed to copy hosts file to ${tempdir}. Aborting ..."; exit 12; }
 cat ${tempdir}/hosts | sed "s/localhost /localhost $myexp_cname /g" | sudo tee /etc/hosts >/dev/null || { echo "Failed to add myExperiment CName to /etc/hosts. Aborting ..."; exit 13; }
-sudo /etc/init.d/mysqld start || { echo "Failed to to start MySQL. Aborting ..."; exit 14; }
+sudo service mysqld start || { echo "Failed to to start MySQL. Aborting ..."; exit 14; }
 sudo patch /etc/mail/sendmail.mc  $tempdir/sendmail.patch || { echo "Could not patch sendmail.mc. Aborting ..."; exit 15; }
 sudo m4 /etc/mail/sendmail.mc | sudo tee /etc/mail/sendmail.cf >/dev/null || { echo "Could not write sendmail config to sendmail.cf. Aborting ..."; exit 16; }
 sudo setsebool -P httpd_can_sendmail=1 || { echo "Could not write set httpd_can_sendmail=1. Aborting ..."; exit 17; }
-sudo /etc/init.d/sendmail start || { echo "Failed to to start Sendmail. Aborting ..."; exit 18; }
+sudo service sendmail start || { echo "Failed to to start Sendmail. Aborting ..."; exit 18; }
 
 echo "Installing Rake version $rake_version and Rails version $rails_version Ruby Gems"
 sudo gem install $nordoc $nori rake --version $rake_version || { echo "Could not install Rake Ruby Gem (version $rake_version). Aborting ..."; exit 19; }
@@ -75,47 +77,48 @@
 rake solr:start || { echo "Could not start Solr server. Aborting ..."; exit 34; }
 
 echo "Adding Firewall rules for mongrel webserver on IPv4 and IPv6"
-sudo iptables -D INPUT -j REJECT --reject-with icmp-host-prohibited || { echo "Could not delete rule from iptables. Aborting ..."; exit 35; }
-sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT || { echo "Could not add rule from iptables. Aborting ..."; exit 36; }
-sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT || { echo "Could not add rule from iptables. Aborting ..."; exit 37; }
-sudo iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited  || { echo "Could not add rule from iptables. Aborting ..."; exit 38; }
-sudo service iptables save  || { echo "Could not save new iptables rules. Aborting ..."; exit 39; }
-sudo restorecon -v /etc/sysconfig/iptables || { echo "Could not restorecon for /etc/sysconfig/iptables. Aborting ..."; exit 40; }
-sudo service iptables restart || { echo "Could not restart iptables. Aborting ..."; exit 41; }
+sudo chkconfig iptables on || { echo "Failed to iptables to applications started at boottime. Aborting ..."; exit 35; }
+sudo iptables -D INPUT -j REJECT --reject-with icmp-host-prohibited || { echo "Could not delete rule from iptables. Aborting ..."; exit 36; }
+sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT || { echo "Could not add rule from iptables. Aborting ..."; exit 37; }
+sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT || { echo "Could not add rule from iptables. Aborting ..."; exit 38; }
+sudo iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited  || { echo "Could not add rule from iptables. Aborting ..."; exit 39; }
+sudo iptables-save | sudo tee /etc/sysconfig/iptables >/dev/null  || { echo "Could not save new iptables rules. Aborting ..."; exit 40; }
+sudo restorecon -v /etc/sysconfig/iptables || { echo "Could not restorecon for /etc/sysconfig/iptables. Aborting ..."; exit 41; }
+sudo service iptables restart || { echo "Could not restart iptables. Aborting ..."; exit 42; }
 
-sudo ip6tables -D INPUT -j REJECT --reject-with icmp6-adm-prohibited || { echo "Could not delete rule from ip6tables. Aborting ..."; exit 42; }
-sudo ip6tables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT || { echo "Could not add rule from ip6tables. Aborting ..."; exit 43; }
-sudo ip6tables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT || { echo "Could not add rule from ip6tables. Aborting ..."; exit 44; }
-sudo ip6tables -A INPUT -j REJECT --reject-with icmp6-adm-prohibited || { echo "Could not delete rule from ip6tables. Aborting ..."; exit 45; }
-sudo service ip6tables save || { echo "Could not save new ip6tables rules. Aborting ..."; exit 46; }
-sudo restorecon -v /etc/sysconfig/ip6tables || { echo "Could not restorecon for /etc/sysconfig/ip6tables. Aborting ..."; exit 47; }
-sudo service ip6tables restart || { echo "Could not restart ip6tables. Aborting ..."; exit 48; }
+sudo chkconfig ip6tables on || { echo "Failed to ip6tables to applications started at boottime. Aborting ..."; exit 43; }
+sudo ip6tables -D INPUT -j REJECT --reject-with icmp6-adm-prohibited || { echo "Could not delete rule from ip6tables. Aborting ..."; exit 44; }
+sudo ip6tables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT || { echo "Could not add rule from ip6tables. Aborting ..."; exit 45; }
+sudo ip6tables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT || { echo "Could not add rule from ip6tables. Aborting ..."; exit 46; }
+sudo ip6tables -A INPUT -j REJECT --reject-with icmp6-adm-prohibited || { echo "Could not delete rule from ip6tables. Aborting ..."; exit 47; }
+sudo ip6tables-save | sudo tee /etc/sysconfig/ip6tables >/dev/null || { echo "Could not save new ip6tables rules. Aborting ..."; exit 48; }
+sudo restorecon -v /etc/sysconfig/ip6tables || { echo "Could not restorecon for /etc/sysconfig/ip6tables. Aborting ..."; exit 49; }
+sudo service ip6tables restart || { echo "Could not restart ip6tables. Aborting ..."; exit 50; }
 
 echo "Installing and configuring Passenger Gem (mod_rails)";
-sudo gem install passenger --version ${passenger_version} || { echo "Could not install Passnger Gem version ${passenger_version}. Aborting ..."; exit 49; }
-sudo su -c "yes | /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/bin/passenger-install-apache2-module" || { echo "Could not install Apache2 module for Passenger. Aborting ..."; exit 50; }
-echo "${apache_config}" | sudo tee /etc/httpd/conf.d/myexp.conf > /dev/null || { echo "Could not add bespoke myExperiment Apache configuration. Aborting ..."; exit 51; }
-sudo chmod -R 755 ${install_dir}/public || { echo "Failed to chmod ${install_dir}/public and its files/subdirectories. Aborting ..."; exit 52; }
-sudo chmod 755 ${install_dir} || { echo "Failed to chmod ${install_dir}. Aborting ..."; exit 53; }
-sudo chcon -t httpd_sys_script_exec_t -R ${install_dir} || { echo "Failed to chcon (httpd_sys_script_exec_t) ${install_dir} and its files/subdirectories. Aborting ..."; exit 54; }
-sudo chcon -t httpd_sys_content_t -R ${install_dir}/public || { echo "Failed to chcon (httpd_sys_content_t) ${install_dir}/public and its files/subdirectories. Aborting ..."; exit 55; }
-sudo chcon -t httpd_log_t -R ${install_dir}/log || { echo "Failed to chcon (httpd_log_t) ${install_dir}/log and its files. Aborting ..."; exit 56; }
-sudo chcon -t httpd_tmpfs_t -R  ${install_dir}/tmp || { echo "Failed to chcon (httpd_tmpfs_t) ${install_dir}/tmp and its files. Aborting ..."; exit 57; }
-sudo setsebool -P httpd_can_network_connect=1 || { echo "Could not write set httpd_can_network_connect=1. Aborting ..."; exit 58; }
-sudo setenforce 0 || { echo "Could not temporarily setenforce = 0. Aborting ..."; exit 59; }
-sudo service httpd start || { echo "Could not start Apache. Aborting ..."; exit 60; }
-sudo grep httpd /var/log/audit/audit.log | audit2allow -M passenger || { echo "Could not create policy package passenger.pp. Aborting ..."; exit 61; }
-sudo semodule -i passenger.pp || { echo "Could not add policy package passenger.pp using semodule. Aborting ..."; exit 62; }
-sudo rm passenger.pp passenger.te || { echo "Could not remove files creates by audit2allow. Aborting ..."; exit 63; }
-sudo setenforce 1 || { echo "Could not temporarily setenforce = 1. Aborting ..."; exit 64; }
-sudo service httpd restart || { echo "Could not restart Apache. Aborting ..."; exit 65; }
+sudo gem install passenger --version ${passenger_version} || { echo "Could not install Passnger Gem version ${passenger_version}. Aborting ..."; exit 51; }
+sudo su -c "yes | /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/bin/passenger-install-apache2-module" || { echo "Could not install Apache2 module for Passenger. Aborting ..."; exit 52; }
+echo "${apache_config}" | sudo tee /etc/httpd/conf.d/myexp.conf > /dev/null || { echo "Could not add bespoke myExperiment Apache configuration. Aborting ..."; exit 53; }
+sudo chmod -R 755 ${install_dir}/public || { echo "Failed to chmod ${install_dir}/public and its files/subdirectories. Aborting ..."; exit 54; }
+sudo chmod 755 ${install_dir} || { echo "Failed to chmod ${install_dir}. Aborting ..."; exit 55; }
+sudo chcon -t httpd_sys_script_exec_t -R ${install_dir} || { echo "Failed to chcon (httpd_sys_script_exec_t) ${install_dir} and its files/subdirectories. Aborting ..."; exit 56; }
+sudo chcon -t httpd_sys_content_t -R ${install_dir}/public || { echo "Failed to chcon (httpd_sys_content_t) ${install_dir}/public and its files/subdirectories. Aborting ..."; exit 57; }
+sudo chcon -t httpd_log_t -R ${install_dir}/log || { echo "Failed to chcon (httpd_log_t) ${install_dir}/log and its files. Aborting ..."; exit 58; }
+sudo chcon -t httpd_tmpfs_t -R  ${install_dir}/tmp || { echo "Failed to chcon (httpd_tmpfs_t) ${install_dir}/tmp and its files. Aborting ..."; exit 59; }
+sudo setsebool -P httpd_can_network_connect=1 || { echo "Could not write set httpd_can_network_connect=1. Aborting ..."; exit 60; }
+sudo setenforce 0 || { echo "Could not temporarily setenforce = 0. Aborting ..."; exit 61; }
+sudo service httpd start || { echo "Could not start Apache. Aborting ..."; exit 62; }
+sudo grep httpd /var/log/audit/audit.log | audit2allow -M passenger || { echo "Could not create policy package passenger.pp. Aborting ..."; exit 63; }
+sudo semodule -i passenger.pp || { echo "Could not add policy package passenger.pp using semodule. Aborting ..."; exit 64; }
+sudo rm passenger.pp passenger.te || { echo "Could not remove files creates by audit2allow. Aborting ..."; exit 65; }
+sudo setenforce 1 || { echo "Could not temporarily setenforce = 1. Aborting ..."; exit 66; }
+sudo service httpd restart || { echo "Could not restart Apache. Aborting ..."; exit 67; }
 
 echo "Removing extended sudo timeout from /etc/sudoers"
-sudo cp /etc/sudoers  ${tempdir}/ || { echo "Could not make a copy of sudoers in temporary directory.  Aborting ..."; exit 66; }
-sudo cat ${tempdir}/sudoers | sed "s/Defaults     timestamp_timeout = 3600//" | sudo tee /etc/sudoers > /dev/null || { echo "Could not remove extended timeout for sudo.  Aborting ..."; exit 67; }
+sudo rm /etc/sudoers.d/default_timeout || { echo "Could not remove extended timeout for sudo.  Aborting ..."; exit 68; }
 
 echo "Removing temporary directory created for writing patch files to"
-sudo rm -rf ${tempdir} || { echo "Could not remove temporary directory used by patch files."; exit 68; }
+sudo rm -rf ${tempdir} || { echo "Could not remove temporary directory used by patch files."; exit 69; }
 
 echo ""
 echo "+-----------------------------------------------------------------------------------------+"

Modified: trunk/installers/ubuntu/install.bash (2888 => 2889)


--- trunk/installers/ubuntu/install.bash	2011-12-21 11:31:44 UTC (rev 2888)
+++ trunk/installers/ubuntu/install.bash	2011-12-21 17:48:32 UTC (rev 2889)
@@ -30,7 +30,7 @@
 	DOLLAR='$'; echo -e "export PATH=${DOLLAR}PATH:/var/lib/gems/1.8/bin\nalias sudo='sudo env PATH=${DOLLAR}PATH'" >> /home/${USER}/.bashrc || { echo "Could not write to /home/${USER}/.bashrc.  Aborting ..."; exit 9;}
 	source /home/${USER}/.bashrc || { echo "Could not source /home/${USER}/.bashrc.  Aborting ..."; exit 10; }
 fi
-sudo gem install ${nordoc} ${nori} mongrel_cluster rubyzip libxml-ruby rmagick dsl_accessor ruby-openid openurl curb marc || { echo "Could not install all remaining generic Ruby Gems required by myExperiment. Aborting ..."; exit 11; }
+sudo gem install ${nordoc} ${nori} rubyzip libxml-ruby rmagick dsl_accessor ruby-openid openurl curb marc || { echo "Could not install all remaining generic Ruby Gems required by myExperiment. Aborting ..."; exit 11; }
 
 echo "Patching bug in Ubuntu 10.04 version of Ruby 1.8.7"
 tempdir=$(mktemp -d /tmp/myexp_installer.XXXXXXXXXX) || { echo "Could not create temporary file for writing patches to. Aborting ..."; exit 12; }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]