From 82ce9e5f41c43d4a99c783cc87683c5987b87c73 Mon Sep 17 00:00:00 2001 From: mechleg Date: Thu, 16 Nov 2017 12:27:48 -0800 Subject: [PATCH] Fedora 27 EZ template initial commit --- cyrus-imap_packages | 1 + cyrus-imap_post-install | 7 + devel_packages | 60 ++++ fedora-27-x86_64-ez.spec | 150 ++++++++ jre_packages | 17 + jsdk_packages | 1 + mailman_packages | 1 + mod_perl_packages | 2 + mod_ssl_packages | 1 + mod_ssl_post-install | 7 + mysql_packages | 4 + os_ct2vm | 723 +++++++++++++++++++++++++++++++++++++++ os_distribution | 1 + os_dummy-systemd | 95 +++++ os_environment | 1 + os_mirrorlist | 4 + os_osrelease | 1 + os_packages | 91 +++++ os_post-cache | 31 ++ os_post-install | 96 ++++++ os_pre-cache | 43 +++ php_packages | 35 ++ phpmyadmin_packages | 1 + phppgadmin_packages | 1 + postgresql_packages | 8 + proftpd_packages | 1 + proftpd_post-install | 7 + spamassassin_packages | 1 + squirrelmail_packages | 1 + tomcat_packages | 6 + tomcat_post-install | 7 + webalizer_packages | 1 + wordpress_packages | 1 + 33 files changed, 1407 insertions(+) create mode 100644 cyrus-imap_packages create mode 100755 cyrus-imap_post-install create mode 100644 devel_packages create mode 100644 fedora-27-x86_64-ez.spec create mode 100644 jre_packages create mode 100644 jsdk_packages create mode 100644 mailman_packages create mode 100644 mod_perl_packages create mode 100644 mod_ssl_packages create mode 100755 mod_ssl_post-install create mode 100644 mysql_packages create mode 100755 os_ct2vm create mode 100644 os_distribution create mode 100644 os_dummy-systemd create mode 100644 os_environment create mode 100644 os_mirrorlist create mode 100644 os_osrelease create mode 100644 os_packages create mode 100755 os_post-cache create mode 100755 os_post-install create mode 100755 os_pre-cache create mode 100644 php_packages create mode 100644 phpmyadmin_packages create mode 100644 phppgadmin_packages create mode 100644 postgresql_packages create mode 100644 proftpd_packages create mode 100755 proftpd_post-install create mode 100644 spamassassin_packages create mode 100644 squirrelmail_packages create mode 100644 tomcat_packages create mode 100755 tomcat_post-install create mode 100644 webalizer_packages create mode 100644 wordpress_packages diff --git a/cyrus-imap_packages b/cyrus-imap_packages new file mode 100644 index 0000000..3088efa --- /dev/null +++ b/cyrus-imap_packages @@ -0,0 +1 @@ +cyrus-imapd diff --git a/cyrus-imap_post-install b/cyrus-imap_post-install new file mode 100755 index 0000000..7a4318a --- /dev/null +++ b/cyrus-imap_post-install @@ -0,0 +1,7 @@ +#!/bin/bash + +# Turn ports on +/usr/bin/firewall-offline-cmd --port 110:tcp --port 143:tcp --port 993:tcp --port 995:tcp --port 4190:tcp > /dev/null 2>&1 +/bin/systemctl try-restart firewalld > /dev/null 2>&1 + +exit 0 diff --git a/devel_packages b/devel_packages new file mode 100644 index 0000000..b18e9ae --- /dev/null +++ b/devel_packages @@ -0,0 +1,60 @@ +autoconf +patchutils +rpm-build +gcc +gcc-c++ +gcc-objc +gdb +openjade +texlive +tex-preview +libtool +automake +cpp +passivetex +texinfo +dejagnu +flex +dos2unix +doxygen +bison +byacc +docbook-style-xsl +xmlto +strace +docbook-dtds +texlive-xmltex +texlive-xmltex-bin +apr-devel +apr-util-devel +cups-devel +libcurl-devel +rpm-devel +python-devel +glib2-devel +gnutls-devel +bzip2-devel +httpd-devel +libattr-devel +libacl-devel +libgcrypt-devel +libgpg-error-devel +audit-libs-devel +unixODBC-devel +tcl-devel +pam-devel +readline-devel +libtiff-devel +libxml2-devel +libxslt-devel +ncurses-devel +net-snmp-devel +libpng-devel +freetype-devel +fontconfig-devel +redhat-rpm-config +nss-devel +nss-softokn-devel +nss-softokn-freebl-devel +gettext-devel +libcap-devel diff --git a/fedora-27-x86_64-ez.spec b/fedora-27-x86_64-ez.spec new file mode 100644 index 0000000..8deee71 --- /dev/null +++ b/fedora-27-x86_64-ez.spec @@ -0,0 +1,150 @@ +# template name attributes +%define templatename fedora +%define templatever 27 +%define templatearch x86_64 + +# Human-readable attributes +%define fullname Fedora %templatever +%define fulltemplatearch (for AMD64/Intel EM64T) + +# template dirs +%define templatedir /vz/template/%templatename/%templatever/%templatearch/config +%define ostemplatedir %templatedir/os/default + +# vzpkgenv related +%define pkgman 410x64 +%define package_manager rpm%pkgman +%define package_manager_pkg vzpkgenv%pkgman >= 7.0.0 + +# Files lists +%define files_lst() \ +find %1 -type d -printf '%%%dir %%%attr(%m,root,root) %p\\n' | sed "s,%buildroot,,g" >> %2\ +find %1 -type f -printf '%%%config %%%attr(%m,root,root) %p\\n' | sed "s,%buildroot,,g" >> %2\ +%nil + +# Sources list +%define sources_lst() \ +%((cd %_sourcedir;\ +s=1;\ +for tmpl in %1; do\ +sources=$tmpl"_*";\ +for file in $sources; do\ +echo Source$s: $file;\ +s=$((s+1))\ +done;\ +done))\ +%nil + +# Obsoletes list +%define obsoletes_lst() \ +%((for tmpl in %1; do\ +[ $tmpl = os ] && continue;\ +echo "Obsoletes: $tmpl-%templatename-%templatever-%templatearch-ez < 7.0.0";\ +echo "Provides: $tmpl-%templatename-%templatever-%templatearch-ez = %version-%release";\ +done))\ +%nil + +# Templates list - packages file should be always present in any template! +%define templates_list() %((cd %_sourcedir; for f in *_packages; do echo -n "${f%_*} "; done)) + +Summary: %fullname %fulltemplatearch Template set +Name: %templatename-%templatever-%templatearch-ez +Group: Virtuozzo/Templates +License: GPL +Version: 7.0.0 +Release: 1%{?dist} +BuildRoot: %_tmppath/%name-root +BuildArch: noarch +Requires: %package_manager_pkg + +# template source files +%sources_lst %templates_list + +# obsoletes +%obsoletes_lst %templates_list + +%description +%fullname %fulltemplatearch packaged as a Virtuozzo Template set. + +%install +installfile() { + local sourcename=%_sourcedir/${1}_$4 + local mode=$2 + local dir=$3 + local name=$4 + + [ ! -f $sourcename ] && return + + install -m $mode $sourcename $dir/$name +} + +rm -f files.lst +for tmpl in %templates_list; do + [ $tmpl = "os" ] && dir=%buildroot/%ostemplatedir || \ + dir=%buildroot/%templatedir/app/$tmpl/default + + mkdir -p $dir + + if [ $tmpl = "os" ]; then + # Os template only files + + # Text + echo "%fullname %fulltemplatearch Virtuozzo Template" > $dir/description + echo "%fullname %fulltemplatearch Virtuozzo Template" > $dir/summary + + # Package manager + echo "%package_manager" > $dir/package_manager + + # Disable upgrade + touch $dir/upgradable_versions + + # Pkgman environment + installfile $tmpl 0644 $dir environment + + # vzctl-related + installfile $tmpl 0644 $dir distribution + + # Kernel virtualization + installfile $tmpl 0644 $dir osrelease + + # Os template cache scripts + installfile $tmpl 0755 $dir pre-cache + installfile $tmpl 0755 $dir post-cache + installfile $tmpl 0755 $dir mid-pre-install + installfile $tmpl 0755 $dir mid-post-install + installfile $tmpl 0755 $dir pre-upgrade + installfile $tmpl 0755 $dir post-upgrade + else + # App templates only files + + # Text + echo "$tmpl for %fullname %fulltemplatearch Virtuozzo Template" > $dir/description + echo "$tmpl for %fullname %fulltemplatearch Virtuozzo Template" > $dir/summary + fi + + # Common things + + # Installation sources + installfile $tmpl 0644 $dir mirrorlist + installfile $tmpl 0644 $dir repositories + + # Packages + installfile $tmpl 0644 $dir packages + + # Scripts + installfile $tmpl 0755 $dir pre-install + installfile $tmpl 0755 $dir pre-install-hn + installfile $tmpl 0755 $dir post-install + installfile $tmpl 0755 $dir post-install-hn + + # Versioning + echo "%release" > $dir/release + echo "%version" > $dir/version + %files_lst $dir files.lst +done + +%files -f files.lst + +%changelog +* Wed Nov 15 2017 mechleg 7.0.0-1 +- Initial release diff --git a/jre_packages b/jre_packages new file mode 100644 index 0000000..805c643 --- /dev/null +++ b/jre_packages @@ -0,0 +1,17 @@ +java-1.8.0-openjdk +apache-commons-collections +apache-commons-logging +apache-commons-daemon +apache-commons-pool +apache-commons-dbcp +xml-commons-apis +xml-commons-resolver +xalan-j2 +xerces-j2 +geronimo-jms +javamail +log4j +log4j12 +geronimo-jta +avalon-framework +avalon-logkit \ No newline at end of file diff --git a/jsdk_packages b/jsdk_packages new file mode 100644 index 0000000..88e6919 --- /dev/null +++ b/jsdk_packages @@ -0,0 +1 @@ +java-1.8.0-openjdk-devel \ No newline at end of file diff --git a/mailman_packages b/mailman_packages new file mode 100644 index 0000000..32165f2 --- /dev/null +++ b/mailman_packages @@ -0,0 +1 @@ +mailman diff --git a/mod_perl_packages b/mod_perl_packages new file mode 100644 index 0000000..17a561a --- /dev/null +++ b/mod_perl_packages @@ -0,0 +1,2 @@ +mod_perl +mod_perl-devel \ No newline at end of file diff --git a/mod_ssl_packages b/mod_ssl_packages new file mode 100644 index 0000000..27d8074 --- /dev/null +++ b/mod_ssl_packages @@ -0,0 +1 @@ +mod_ssl diff --git a/mod_ssl_post-install b/mod_ssl_post-install new file mode 100755 index 0000000..d3e158e --- /dev/null +++ b/mod_ssl_post-install @@ -0,0 +1,7 @@ +#!/bin/bash + +# Turn ports on +/usr/bin/firewall-offline-cmd --port 443:tcp > /dev/null 2>&1 +/bin/systemctl try-restart firewalld > /dev/null 2>&1 + +exit 0 diff --git a/mysql_packages b/mysql_packages new file mode 100644 index 0000000..bd939f4 --- /dev/null +++ b/mysql_packages @@ -0,0 +1,4 @@ +mariadb-server +mariadb-devel +mariadb-bench +perl-DBD-MySQL \ No newline at end of file diff --git a/os_ct2vm b/os_ct2vm new file mode 100755 index 0000000..d450c45 --- /dev/null +++ b/os_ct2vm @@ -0,0 +1,723 @@ +#!/bin/bash + +SCRIPT_NAME=`basename $0` + +SCRIPTVERSION=28 +NEEDSPACE=150000 + +DATADIR="/usr/share/libvznbdmig" + +. $DATADIR/ct2vmlib + +#getmigscript $SCRIPT_NAME >/dev/null 2>&1 + +TMPLOSNAME=fedora +TMPLVERSION=23 +TMPLARCH=x86_64 + +if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm44x86" +else + TMPLENV="rpm44x64" +fi + +SYSLOG_SCRIPT="syslog" +CT2VM_PACKAGES_RM="vzdummy-jre-fc6 vzdummy-kernel-el5 vzdummy-apache vzdev +vzdummy-glibc vzdummy-kernel-utils-el5" +CT2VM_PACKAGES_ADD="kernel grub kernel-devel make gcc" +CT2VM_PACKAGES_ADD_GRUB2="kernel grub2 kernel-devel make gcc" +CT2VM_PACKAGES_POST_RM="" +ADD_KERNEL_BOOT_OPTS="" +VEID=$1 +NBD_PATH=$2 +MSG_LEVEL=$3 +CHECK_PACKAGES=$4 + +OPTS=`getopt -o b: \ + --long boot_device: \ + -n $SCRIPT_NAME -- "$@"` + +if [ $? != 0 ] ; then usage; exit 1 ; fi + +eval set -- "$OPTS" + +while true ; do + case "$1" in + --boot_device) + NBD_GRUB_PDEV=$2 + shift + ;; + --) + shift + break + ;; + *) + break + ;; + esac +done + +if [ "x$NBD_GRUB_PDEV" = "x" ]; then + INSTDEVICE="/dev/hda1" + DEVMAJOR=3 + DEVMINOR=1 + BOOT="/boot" +else + BOOT="" + GRUB_DEVICE="/dev/hda1" + GRUB_DEVMAJOR=3 + GRUB_DEVMINOR=1 + INSTDEVICE="/dev/hda2" + DEVMAJOR=3 + DEVMINOR=2 +fi +FSOPTIONS="defaults" +INITRD_OPTS="--rootdev=$INSTDEVICE" +USE_UPSTART=no +USE_NEW_UPSTART=no +USE_SYSTEMD=no +BOOT_KERNEL=1 + +case "$TMPLOSNAME" in + centos) + TMPLTITLE="CentOS Linux $TMPLVERSION" + case "$TMPLVERSION" in + 4) + CT2VM_PACKAGES_RM="vzdummy-kernel-ce4 vzdev vzdummy-glibc vzdummy-udev-as4" + INITRD_OPTS="" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm43x86" + else + TMPLENV="rpm43x64" + fi + ;; + 5) + DEVMAJOR=8 + if [ "x$NBD_GRUB_PDEV" = "x" ]; then + INSTDEVICE="/dev/sda1" + else + GRUB_DEVICE="/dev/sda1" + INSTDEVICE="/dev/sda2" + GRUB_DEVMAJOR=8 + fi + INITRD_OPTS="--with=ahci" + ;; + 6) + SYSLOG_SCRIPT="rsyslog" + DEVMAJOR=8 + if [ "x$NBD_GRUB_PDEV" = "x" ]; then + INSTDEVICE="/dev/sda1" + else + GRUB_DEVICE="/dev/sda1" + INSTDEVICE="/dev/sda2" + GRUB_DEVMAJOR=8 + fi + USE_NEW_UPSTART=yes + CT2VM_PACKAGES_RM="vzdev vzdummy-init-fc13" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD module-init-tools" + INITRD_OPTS="--rootdev=$INSTDEVICE" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm47x86" + else + TMPLENV="rpm47x64" + fi + ;; + 7) + USE_SYSTEMD=yes + CT2VM_PACKAGES_RM="vzdummy-systemd-el7" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD_GRUB2 e2fsprogs" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="3.10.0" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm410x86" + else + TMPLENV="rpm410x64" + fi + ADD_KERNEL_BOOT_OPTS="selinux=0 noselinux net.ifnames=0" + DEVMAJOR=8 + if [ "x$NBD_GRUB_PDEV" = "x" ]; then + INSTDEVICE="/dev/sda1" + else + GRUB_DEVICE="/dev/sda1" + INSTDEVICE="/dev/sda2" + GRUB_DEVMAJOR=8 + fi + ;; + esac + ;; + redhat) + case "$TMPLVERSION" in + el7) + TMPLTITLE="RedHat Enterprise Linux 7" + USE_SYSTEMD=yes + CT2VM_PACKAGES_RM="vzdummy-systemd-el7" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD_GRUB2 e2fsprogs" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="3.10.0" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm410x86" + else + TMPLENV="rpm410x64" + fi + ADD_KERNEL_BOOT_OPTS="selinux=0 noselinux net.ifnames=0" + DEVMAJOR=8 + if [ "x$NBD_GRUB_PDEV" = "x" ]; then + INSTDEVICE="/dev/sda1" + else + GRUB_DEVICE="/dev/sda1" + INSTDEVICE="/dev/sda2" + GRUB_DEVMAJOR=8 + fi + ;; + el6) + SYSLOG_SCRIPT="rsyslog" + DEVMAJOR=8 + if [ "x$NBD_GRUB_PDEV" = "x" ]; then + INSTDEVICE="/dev/sda1" + else + GRUB_DEVICE="/dev/sda1" + INSTDEVICE="/dev/sda2" + GRUB_DEVMAJOR=8 + fi + TMPLTITLE="RedHat Enterprise Linux 6" + USE_NEW_UPSTART=yes + CT2VM_PACKAGES_RM="vzdev vzdummy-init-fc13" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD module-init-tools" + INITRD_OPTS="--rootdev=$INSTDEVICE" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm47x86" + else + TMPLENV="rpm47x64" + fi + ;; + el5) + DEVMAJOR=8 + TMPLTITLE="RedHat Enterprise Linux 5" + if [ "x$NBD_GRUB_PDEV" = "x" ]; then + INSTDEVICE="/dev/sda1" + else + GRUB_DEVICE="/dev/sda1" + INSTDEVICE="/dev/sda2" + GRUB_DEVMAJOR=8 + fi + INITRD_OPTS="--with=ahci" + ;; + *) + TMPLTITLE="RedHat Enterprise Linux 4" + INITRD_OPTS="" + CT2VM_PACKAGES_RM="vzdummy-kernel-as4 vzdev vzdummy-glibc vzdummy-udev-as4" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm43x86" + else + TMPLENV="rpm43x64" + fi + ;; + esac + ;; + asianux) + TMPLTITLE="Asianux 3" + ;; + oracle) + TMPLTITLE="Oracle Enterprise Linux 5" + ;; + fedora-core|fedora) + SYSLOG_SCRIPT="rsyslog" + if [ "x$NBD_GRUB_PDEV" = "x" ]; then + INSTDEVICE="/dev/sda1" + DEVMAJOR=8 + else + GRUB_DEVICE="/dev/sda1" + INSTDEVICE="/dev/sda2" + DEVMAJOR=8 + GRUB_DEVMAJOR=8 + fi + TMPLTITLE="Fedora $TMPLVERSION" + case "$TMPLVERSION" in + 9) + CT2VM_PACKAGES_RM="vzdummy-kernel-fc9 vzdev vzdummy-glibc vzdummy-jre-fc9" + INITRD_OPTS="--rootdev=$INSTDEVICE --with=sd_mod --with-avail=ata_piix" + ;; + 11|12) + USE_UPSTART=yes + CT2VM_PACKAGES_RM="vzdev vzdummy-jre-fc9" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD mkinitrd" + INITRD_OPTS="--rootdev=$INSTDEVICE" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm47x86" + else + TMPLENV="rpm47x64" + fi + ;; + 13) + USE_NEW_UPSTART=yes + CT2VM_PACKAGES_RM="vzdev vzdummy-jre-fc12" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD dracut" + INITRD_OPTS="--rootdev=$INSTDEVICE" + ADD_KERNEL_BOOT_OPTS="selinux=0" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm48x86" + else + TMPLENV="rpm48x64" + fi + ;; + 14) + USE_NEW_UPSTART=yes + CT2VM_PACKAGES_RM="vzdev vzdummy-jre-fc12" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD e2fsprogs" + INITRD_OPTS="--rootdev=$INSTDEVICE" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm48x86" + else + TMPLENV="rpm48x64" + fi + ;; + 15) + if [ -f $NBD_PATH/lib/systemd/system/openvz.target ]; then + USE_SYSTEMD=yes + else + USE_NEW_UPSTART=yes + fi + CT2VM_PACKAGES_RM="vzdev vzdummy-init-fc15 vzdummy-systemd-fc15 vzdummy-kernel" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD e2fsprogs vzdummy-kernel-remove" + CT2VM_PACKAGES_POST_RM="vzdummy-kernel-remove" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="2.6.38.6" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm49x86" + else + TMPLENV="rpm49x64" + fi + ;; + 16) + USE_SYSTEMD=yes + CT2VM_PACKAGES_RM="vzdev vzdummy-systemd-fc16 vzdummy-kernel" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD e2fsprogs vzdummy-kernel-remove" + CT2VM_PACKAGES_POST_RM="vzdummy-kernel-remove" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="3.1.0" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm49x86" + else + TMPLENV="rpm49x64" + fi + ;; + 17) + USE_SYSTEMD=yes + CT2VM_PACKAGES_RM="vzdummy-systemd-f17" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD e2fsprogs" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="3.3.4" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm49db5x86" + else + TMPLENV="rpm49db5x64" + fi + ;; + 18) + USE_SYSTEMD=yes + CT2VM_PACKAGES_RM="vzdummy-systemd-f18" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD e2fsprogs dkms" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="3.7.2" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm410x86" + else + TMPLENV="rpm410x64" + fi + ;; + 19) + USE_SYSTEMD=yes + CT2VM_PACKAGES_RM="vzdummy-systemd-f19" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD_GRUB2 e2fsprogs dkms" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="3.9.8" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm410x86" + else + TMPLENV="rpm410x64" + fi + ADD_KERNEL_BOOT_OPTS="selinux=0 noselinux net.ifnames=0" + ;; + 20) + USE_SYSTEMD=yes + CT2VM_PACKAGES_RM="vzdummy-systemd-f20" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD_GRUB2 e2fsprogs dkms" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="3.11.9" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm410x86" + else + TMPLENV="rpm410x64" + fi + ADD_KERNEL_BOOT_OPTS="selinux=0 noselinux net.ifnames=0" + ;; + 21) + USE_SYSTEMD=yes + CT2VM_PACKAGES_RM="vzdummy-systemd-f21" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD_GRUB2 e2fsprogs dkms" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="3.17.4" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm410x86" + else + TMPLENV="rpm410x64" + fi + ADD_KERNEL_BOOT_OPTS="selinux=0 noselinux net.ifnames=0" + ;; + 22) + USE_SYSTEMD=yes + CT2VM_PACKAGES_RM="vzdummy-systemd-f22" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD_GRUB2 e2fsprogs dkms" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="4.0.4" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm410x86" + else + TMPLENV="rpm410x64" + fi + ADD_KERNEL_BOOT_OPTS="selinux=0 noselinux net.ifnames=0" + ;; + 23) + USE_SYSTEMD=yes + CT2VM_PACKAGES_RM="vzdummy-systemd-f23" + CT2VM_PACKAGES_ADD="$CT2VM_PACKAGES_ADD_GRUB2 e2fsprogs dkms" + INITRD_OPTS="--rootdev=$INSTDEVICE" + export VIRT_OSRELEASE="4.2.6" + if [ $TMPLARCH = x86 ]; then + TMPLENV="rpm410x86" + else + TMPLENV="rpm410x64" + fi + ADD_KERNEL_BOOT_OPTS="selinux=0 noselinux net.ifnames=0" + BOOT_KERNEL=0 + ;; + esac + ;; + *) + TMPLTITLE="RedHat-based Enterprise Linux 5" + ;; +esac + +RUN_FROM_CHROOT="$DATADIR/run_from_chroot /vz/pkgenv/$TMPLENV" +RUN_FROM_CHROOT2="$DATADIR/run_from_chroot" + +. /etc/vz/conf/$VEID.conf +. /etc/vz/vz.conf + +function usage() { + echo "Usage: $0 CTID NBD_PATH MSG_LEVEL [ CHECK_PACKAGES ] [ --grub_device=NBD_GRUB_PDEV ]" +} + +function cleanup(){ + return 0 +} + +function clean_environment() { + # Clean environment for fc11 and 12 + if [ $USE_UPSTART = "yes" ] || [ $USE_NEW_UPSTART = "yes" ]; then + rm -f $NBD_PATH/var/lib/rpm/__db* >/dev/null 2>&1 + fi +} + +if [ "x$VEID" = "x" ]; then + usage + error_msg "You should give CTID" $ERR_TMPL +fi + +if [ "x$CHECK_PACKAGES" = "xcheck_packages" ]; then + $VZPKG install $VEID -q -n -p $CT2VM_PACKAGES_ADD >/dev/null 2>&1 + if [ $? -ne 0 ]; then + error_msg "Can't download packages: $VZPKG install $VEID -q -n -p $CT2VM_PACKAGES_ADD failed" $ERR_TMPL + else + exit 0 + fi +fi + +if [ ! -d $NBD_PATH ] || [ "x$NBD_PATH" = "x" ] || [ "x$NBD_PATH" = "/" ]; then + usage + error_msg "You should give right NBD_PATH ($NBD_PATH)" $ERR_TMPL +fi + +if [ "x$INSTDEVICE" = "x" ]; then + usage + error_msg "You should give device" $ERR_TMPL +fi + +clean_environment + +# Remove and install packages +remove_packages + +# Create devices +/bin/mknod $NBD_PATH/dev/null c 1 3 >/dev/null 2>&1 +/bin/chmod 666 $NBD_PATH/dev/null >/dev/null 2>&1 + +clean_environment + +install_packages_rpm + +install_rhel_tools_script + +clean_environment + + +if [ "x$CT2VM_PACKAGES_POST_RM" != "x" ]; then + msg $MSG_INFO "Removing additionally installed packages..." + for i in $CT2VM_PACKAGES_POST_RM; do + $RUN_FROM_CHROOT /usr/lib/rpm/rpmi -e --noscripts --nodeps \ + --root $NBD_PATH $i >/dev/null 2>&1 + done + clean_environment +fi + +msg $MSG_INFO "Changing config files..." + +if [ $USE_UPSTART = "yes" ]; then + + # Recreate tty scripts + for i in tty1 tty2 tty3 tty4 tty5 tty6; do + echo "# $i - getty +# +# This service maintains a getty on $i from the point the system is +# started until it is shut down again. + +start on stopped rc2 +start on stopped rc3 +start on stopped rc4 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 6 + +respawn +exec /sbin/mingetty $i +" > $NBD_PATH/etc/event.d/$i + done +fi + +if [ $USE_NEW_UPSTART = "yes" ]; then + rm -f $NBD_PATH/etc/init/tty2.conf > /dev/null 2>&1 + rm -f $NBD_PATH/etc/init/console.conf > /dev/null 2>&1 + mv -f $NBD_PATH/etc/init.removed/*.conf $NBD_PATH/etc/init + rm -rf $NBD_PATH/etc/init.removed +fi + +if [ $USE_SYSTEMD = "yes" ]; then + rm -f $NBD_PATH/etc/systemd/system/default.target > /dev/null 2>&1 + ln -s /lib/systemd/system/runlevel3.target \ + $NBD_PATH/etc/systemd/system/default.target > /dev/null 2>&1 + + # Fix gettys + if [ -h "$NBD_PATH/etc/systemd/system/getty.target.wants/getty@tty2.service" \ + -a ! -f "$NBD_PATH/etc/systemd/system/getty.target.wants/getty@tty1.service" ]; then + cp -d "$NBD_PATH/etc/systemd/system/getty.target.wants/getty@tty2.service" \ + "$NBD_PATH/etc/systemd/system/getty.target.wants/getty@tty1.service" > /dev/null 2>&1 + fi +fi + +# Remove modules.dep script +if [ -x $NBD_PATH/etc/init.d/modules_dep ]; then + $RUN_FROM_CHROOT2 $NBD_PATH /sbin/chkconfig --del modules_dep >/dev/null 2>&1 + rm -f $NBD_PATH/etc/init.d/modules_dep > /dev/null 2>&1 +fi + +# Fix syslog +if [ -f $NBD_PATH/etc/init.d/$SYSLOG_SCRIPT ]; then + mv -f $NBD_PATH/etc/init.d/$SYSLOG_SCRIPT "$NBD_PATH/etc/init.d/$SYSLOG_SCRIPT"_vz + cat "$NBD_PATH/etc/init.d/$SYSLOG_SCRIPT"_vz | \ + sed "s,passed klogd skipped #,,g" | \ + sed "s,#status klogd,status klogd,g" > \ + $NBD_PATH/etc/init.d/$SYSLOG_SCRIPT && \ + chmod 0755 $NBD_PATH/etc/init.d/$SYSLOG_SCRIPT; \ + rm -f "$NBD_PATH/etc/init.d/$SYSLOG_SCRIPT"_vz || \ + mv -f "$NBD_PATH/etc/init.d/$SYSLOG_SCRIPT"_vz $NBD_PATH/etc/init.d/$SYSLOG_SCRIPT +fi + +# Fix fstab +fix_fstab + +if [ $USE_UPSTART = "no" ] && [ $USE_NEW_UPSTART = "no" ] && [ $USE_SYSTEMD = "no" ]; then +# Add back mingettys to /etc/inittab + add_mingettys +fi + +# Remove vzreboot +rm -f $NBD_PATH/etc/rc.d/rc6.d/S00vzreboot >/dev/null 2>&1 + +# Tune grub.conf +echo " +splashimage=(hd0,0)$BOOT/grub/splash.xpm.gz +timeout=5 +default=1 +" > $NBD_PATH/boot/grub/grub.conf + +if [ ! -f $NBD_PATH/boot/grub/menu.lst ]; then + ln -s ./grub.conf $NBD_PATH/boot/grub/menu.lst +fi + +msg $MSG_INFO "Configuring network..." + +mv $NBD_PATH/etc/sysconfig/network \ +$NBD_PATH/etc/sysconfig/network_vzdev > /dev/null 2>&1 +cat $NBD_PATH/etc/sysconfig/network_vzdev 2>/dev/null | \ + sed "s,^GATEWAYDEV.*,GATEWAYDEV=\"eth0\",g" | \ + sed "s,^IPV6_DEFAULTDEV.*,IPV6_DEFAULTDEV=\"eth0\",g" \ +> $NBD_PATH/etc/sysconfig/network +rm -f $NBD_PATH/etc/sysconfig/network_vzdev >/dev/null 2>&1 +rm -f $NBD_PATH/etc/sysconfig/network-scripts/*venet* >/dev/null 2>&1 +rm -f $NBD_PATH/etc/sysconfig/network-scripts/ifcfg-eth* >/dev/null 2>&1 + +if [ "x$IP_ADDRESS" = "x0.0.0.0" ]; then + IP_ADDRESS="" +fi + +# Preserve netif settings +NETIF_IPV4_LIST=`echo $NETIF | grep ip= | \ +sed -e "s,.*ip=,,g" -e "s,\,.*,,g" -e "s,:, ,g" 2>/dev/null` + +NETIF_IPV6_LIST=`echo $NETIF | grep ip6= | \ +sed -e "s,.*ip6=,,g" -e "s,\,, ,g" -e "s,\"$,,g" 2>/dev/null` + +NETIF_IPV4_DHCP=1 +echo $NETIF | grep dhcp=yes >/dev/null 2>&1 +NETIF_IPV4_DHCP=$? + +NETIF_IPV6_DHCP=1 +echo $NETIF | grep dhcp6=yes >/dev/null 2>&1 +NETIF_IPV6_DHCP=$? + +if [ "x$NETIF_IPV4_LIST" != "x" ] || [ "x$NETIF_IPV6_LIST" != "x" ]; then + IP_ADDRESS="$IP_ADDRESS $NETIF_IPV4_LIST $NETIF_IPV6_LIST" +fi + +if [ "x$IP_ADDRESS" != "x" ] || [ $NETIF_IPV4_DHCP -eq 0 ]; then + ipv4addr="" + ipv6addr="" + NETDEVICE="eth0" + if [ $NETIF_IPV4_DHCP -eq 0 ]; then + echo "DEVICE=$NETDEVICE +ONBOOT=yes +BOOTPROTO=dhcp +" > $NBD_PATH/etc/sysconfig/network-scripts/ifcfg-$NETDEVICE + if [ $NETIF_IPV6_DHCP -eq 0 ]; then + echo "DHCPV6C=yes +" >> $NBD_PATH/etc/sysconfig/network-scripts/ifcfg-$NETDEVICE + fi + else + echo "DEVICE=$NETDEVICE +ONBOOT=yes +BOOTPROTO=static +IPADDR=127.0.0.1 +NETMASK=255.255.255.255 +BROADCAST=0.0.0.0 +" > $NBD_PATH/etc/sysconfig/network-scripts/ifcfg-$NETDEVICE + fi + + ipv6init=0 + # Setup IPV6 first + for i in $IP_ADDRESS; do + ipv6addr=`echo $i | grep ":"` + if [ "x$ipv6addr" != "x" ]; then + if `echo $ipv6addr | grep -v "/" >/dev/null`; then + ipv6addr="$ipv6addr/64" + fi + if [ $ipv6init -eq 0 ]; then + echo "IPV6INIT=\"yes\" +" >> $NBD_PATH/etc/sysconfig/network-scripts/ifcfg-$NETDEVICE + ipv6init=1 + fi + IPV6_SECONDARIES="$IPV6_SECONDARIES $ipv6addr" + fi + done + + if [ "x$IPV6_SECONDARIES" != "x" ]; then + echo "IPV6ADDR_SECONDARIES=\"$IPV6_SECONDARIES\" +" >> $NBD_PATH/etc/sysconfig/network-scripts/ifcfg-$NETDEVICE + fi + + # Then setup IPV4 + NETDEVICE_COUNT=1 + for i in $IP_ADDRESS; do + ipv4addr=`echo $i | grep "\." | sed "s,\/.*,,g"` + ipv4mask=`echo $i | grep / | sed "s,.*\/,,g"` + if [ "x$ipv4mask" = "x" ]; then + ipv4mask="255.255.255.0" + fi + if [ "x$ipv4addr" != "x" ]; then + if [ $NETDEVICE_COUNT -gt 0 ]; then + NETDEVICE="eth0:$((NETDEVICE_COUNT-1))" + fi + echo " +DEVICE=$NETDEVICE +ONBOOT=yes +IPADDR=\"$ipv4addr\" +NETMASK=\"$ipv4mask\" +" > $NBD_PATH/etc/sysconfig/network-scripts/ifcfg-$NETDEVICE + NETDEVICE_COUNT=$((NETDEVICE_COUNT+1)) + fi + done +fi + +set_nameserver + +msg $MSG_INFO "Configuring kernel..." +if [ $BOOT_KERNEL -eq 0 ]; then + for f in vmlinuz System.map config; do + fm=`find $NBD_PATH/usr/lib/modules/ -type f -name $f` + bname=`basename $fm` + uname=`echo $fm | sed -e "s,.*/4,4,g" -e "s,\/.*,,g"` + cp -a $fm $NBD_PATH/boot/$bname-$uname + done +fi + +AVAILABLE_KERNELS=`find $NBD_PATH/boot -name vmlinuz*` + +[ "x$AVAILABLE_KERNELS" = "x" ] && error_msg "No any kernel available" \ +$ERR_TMPL + +# Make root device +for i in $INSTDEVICE /dev/root; do + /bin/mknod $NBD_PATH/$i b $DEVMAJOR $DEVMINOR >/dev/null 2>&1 + /bin/chmod 660 $NBD_PATH/$i >/dev/null 2>&1 +done + +# Make grub device +if [ "x$GRUB_DEVICE" != "x" ]; then + /bin/mknod $NBD_PATH/$GRUB_DEVICE b $GRUB_DEVMAJOR $GRUB_DEVMINOR \ + >/dev/null 2>&1 + /bin/chmod 660 $NBD_PATH/$GRUB_DEVICE >/dev/null 2>&1 +fi + +# Get kernel version and write it to grub +for i in $AVAILABLE_KERNELS; do + KERN_VERSION=`echo $i | sed "s,.*vmlinuz-,,g"`; + export VIRT_OSRELEASE=$KERN_VERSION + + # Update depmod + $RUN_FROM_CHROOT2 $NBD_PATH /sbin/depmod $KERN_VERSION >/dev/null 2>&1 + + # Create proper initrd + rm -f $NBD_PATH/boot/initrd-$KERN_VERSION.img + + if [ -x $NBD_PATH/sbin/mkinitrd ]; then + MKINITRD="/sbin/mkinitrd" + else + MKINITRD="/usr/bin/mkinitrd" + fi + + $RUN_FROM_CHROOT2 $NBD_PATH $MKINITRD $INITRD_OPTS \ + /boot/initrd-$KERN_VERSION.img $KERN_VERSION >/dev/null 2>&1 + + [ ! -f $NBD_PATH/boot/initrd-$KERN_VERSION.img ] && \ + error_msg "Failed to create initrd image" $ERR_TMPL + + echo " +title $TMPLTITLE ($KERN_VERSION) + root (hd0,0) + kernel $BOOT/vmlinuz-$KERN_VERSION ro $ADD_KERNEL_BOOT_OPTS root=$INSTDEVICE + initrd $BOOT/initrd-$KERN_VERSION.img +" >> $NBD_PATH/boot/grub/grub.conf + +done + +exit 0 diff --git a/os_distribution b/os_distribution new file mode 100644 index 0000000..6c7ceb2 --- /dev/null +++ b/os_distribution @@ -0,0 +1 @@ +fedora-core diff --git a/os_dummy-systemd b/os_dummy-systemd new file mode 100644 index 0000000..bc52e13 --- /dev/null +++ b/os_dummy-systemd @@ -0,0 +1,95 @@ +Summary: Dummy package to fix systemd initscripts configs +Name: vzdummy-systemd-f23 +Group: Applications/System +Vendor: Parallels +License: GPL +Version: 1.0 +Release: 1 +Autoreq: 0 +BuildRoot: %_tmppath/%name-root +BuildArch: noarch +Obsoletes: vzdummy-systemd-fc22 + +%description +Dummy package to fix systemd initscripts configs + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system +mkdir -p $RPM_BUILD_ROOT/etc/systemd/system/default.target.wants +mkdir -p $RPM_BUILD_ROOT/lib/systemd/system/reboot.target.wants + +cat >> $RPM_BUILD_ROOT/usr/lib/systemd/system/vzfifo.service << EOL +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +[Unit] +Description=Tell that Container is started +ConditionPathExists=/proc/vz +ConditionPathExists=!/proc/bc +After=multi-user.target quotaon.service quotacheck.service + +[Service] +Type=forking +ExecStart=/bin/touch /.vzfifo +TimeoutSec=0 +RemainAfterExit=no +SysVStartPriority=99 +EOL + +ln -s /usr/lib/systemd/system/vzfifo.service \ + $RPM_BUILD_ROOT/etc/systemd/system/default.target.wants/vzfifo.service + +ln -s /usr/lib/systemd/system/quotaon.service \ + $RPM_BUILD_ROOT/etc/systemd/system/default.target.wants/quotaon.service + +ln -s /usr/lib/systemd/system/quotaon.service \ + $RPM_BUILD_ROOT/etc/systemd/system/default.target.wants/quotacheck.service + +cat >> $RPM_BUILD_ROOT/usr/lib/systemd/system/vzreboot.service << EOL +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +[Unit] +Description=Tell that Container is rebooted +ConditionPathExists=/proc/vz +ConditionPathExists=!/proc/bc +Before=systemd-reboot.service +DefaultDependencies=no + +[Service] +Type=forking +ExecStart=/bin/touch /reboot +TimeoutSec=0 +RemainAfterExit=no +EOL + +ln -s /usr/lib/systemd/system/vzreboot.service \ + $RPM_BUILD_ROOT/lib/systemd/system/reboot.target.wants/vzreboot.service + +%triggerin -- iputils +# Clear cap_net_admin capability from pings +for file in "/bin/ping" "/bin/ping6"; do + setcap cap_net_raw+ep $file > /dev/null 2>&1 +done +: + +%files +%attr(0644, root, root) /usr/lib/systemd/system/vzfifo.service +%attr(0644, root, root) /usr/lib/systemd/system/vzreboot.service +/etc/systemd/system/default.target.wants/quotacheck.service +/etc/systemd/system/default.target.wants/quotaon.service +/etc/systemd/system/default.target.wants/vzfifo.service +/lib/systemd/system/reboot.target.wants/vzreboot.service + +%changelog +* Tue Jun 09 2015 Konstantin Volckov 1.0-1 +- created diff --git a/os_environment b/os_environment new file mode 100644 index 0000000..f0d6b62 --- /dev/null +++ b/os_environment @@ -0,0 +1 @@ +SYSTEMD_LOG_TARGET=console diff --git a/os_mirrorlist b/os_mirrorlist new file mode 100644 index 0000000..6b6253a --- /dev/null +++ b/os_mirrorlist @@ -0,0 +1,4 @@ +$SW_SERVER/download/mirrors/fedora-23 +$SW_SERVER/download/mirrors/updates-released-f23 +http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-27&arch=x86_64 +http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f27&arch=x86_64 diff --git a/os_osrelease b/os_osrelease new file mode 100644 index 0000000..e33e13b --- /dev/null +++ b/os_osrelease @@ -0,0 +1 @@ +4.13.12 diff --git a/os_packages b/os_packages new file mode 100644 index 0000000..48f1503 --- /dev/null +++ b/os_packages @@ -0,0 +1,91 @@ +authconfig +bash +coreutils +crontabs +cronie +cronie-noanacron +diffutils +dhclient +file +hostname +rootfiles +info +passwd +rpm +man-db +man-pages +tmpwatch +logrotate +bind +finger +finger-server +firewalld +ftp +httpd +mailcap +iproute +iptables +iptables-services +jwhois +openssh-clients +openssh-server +net-snmp +net-snmp-utils +nscd +rsync +rsyslog +samba +samba-client +sendmail +sendmail-cf +sendmail-doc +stunnel +talk +talk-server +xinetd +aspell +aspell-en +perl +python +slang +tcsh +ed +less +vim-minimal +vim-enhanced +lynx +acl +attr +binutils +bzip2 +curl +e2fsprogs +elfutils +ethtool +fetchmail +gnupg +gzip +make +mailx +ncompress +ntsysv +lsof +rpcbind +quota +tcpdump +telnet +time +traceroute +screen +setuptool +sharutils +mlocate +sudo +unzip +wget +which +tar +xz +xz-lzma-compat +dnf +vzdummy-systemd-f23 diff --git a/os_post-cache b/os_post-cache new file mode 100755 index 0000000..2a7de9a --- /dev/null +++ b/os_post-cache @@ -0,0 +1,31 @@ +#!/bin/bash + +#sanify check + +if [ $# -lt 1 ] ; then + echo "usage $0 ROOTDIR" + exit 1 +fi + +rootdir=$1 + +if [ -z "$rootdir" ]; then + echo "ROOTDIR is not set." + exit 1 +fi + +# Check root directory +if [ ! -d $rootdir ]; then + echo "$rootdir: should be a directory." + exit 1 +fi + +pushd $rootdir > /dev/null + +[ -f etc/localtime ] && rm -f etc/localtime +ln -s ../usr/share/zoneinfo/Host etc/localtime +cp -fp /etc/localtime usr/share/zoneinfo/Host +[ -f /etc/sysconfig/i18n ] && cp -fp /etc/sysconfig/i18n etc/sysconfig/i18n + +popd > /dev/null + diff --git a/os_post-install b/os_post-install new file mode 100755 index 0000000..c420ebc --- /dev/null +++ b/os_post-install @@ -0,0 +1,96 @@ +#!/bin/bash + +function move_file() { + [ $# -eq 2 ] || exit 1 + local src=$1 dst=$2 + + chown --reference=$dst $src || exit 1 + chmod --reference=$dst $src || exit 1 + mv -f $src $dst +} + +pushd / >/dev/null + +[ ! -e etc/mtab ] && ln -s /proc/mounts etc/mtab > /dev/null 2>&1 + +# Convert system to shadow password files +/usr/sbin/pwconv > /dev/null 2>&1 + +for conf in 00-system 50-coredump 50-default; do + CFG_FILE=lib/sysctl.d/$conf.conf + if [ -f $CFG_FILE ]; then + sed -e "s,^net.bridge\.,# net.bridge.,g" \ + -e "s,^net.ipv4.conf\.,# net.ipv4.conf.,g" \ + -e "s,^kernel.core_pattern,# kernel.core_pattern,g" \ + -e "s,^kernel.core_uses_pid,# kernel.core_uses_pid,g" \ + -e "s,^kernel.sysrq,# kernel.sysrq,g" \ + $CFG_FILE > ${CFG_FILE}.$$ && \ + move_file ${CFG_FILE}.$$ $CFG_FILE > /dev/null 2>&1 + fi +done + +# turn services on +list="network httpd sshd xinetd saslauthd sendmail crond firewalld" +for i in $list; do + /bin/systemctl enable $i.service > /dev/null 2>&1 +done + +# turn services off +list="rpcbind" +for i in $list; do + /bin/systemctl disable $i.service > /dev/null 2>&1 +done + +# disable all cron jobs +for i in hourly daily weekly monthly; do + chmod a-x /etc/cron.${i}/* > /dev/null 2>&1 +done +# enable logrotate +chmod a+x /etc/cron.daily/logrotate > /dev/null 2>&1 + +# Fix sshd_config +CFG_FILE=etc/ssh/sshd_config +if [ -f $CFG_FILE ]; then + sed -e "s/^X11Forwarding yes/X11Forwarding no/" \ + $CFG_FILE > ${CFG_FILE}.$$ && \ + move_file ${CFG_FILE}.$$ $CFG_FILE > /dev/null 2>&1 +fi + +# Turn apache ports on +/usr/bin/firewall-offline-cmd --port 80:tcp > /dev/null 2>&1 + +# apache tuning +echo "# prefork MPM +# StartServers: number of server processes to start +# MinSpareServers: minimum number of server processes which are kept spare +# MaxSpareServers: maximum number of server processes which are kept spare +# ServerLimit: maximum value for MaxClients for the lifetime of the server +# MaxClients: maximum number of server processes allowed to start +# MaxRequestsPerChild: maximum number of requests a server process serves + +StartServers 1 +MinSpareServers 1 +MaxSpareServers 5 +ServerLimit 10 +MaxClients 10 +MaxRequestsPerChild 4000 + +" > etc/httpd/conf.d/mpm_prefork.conf + +# saslauthd tuning +CFG_FILE=etc/sysconfig/saslauthd +if [ -f $CFG_FILE ]; then + sed -e "s/^FLAGS=/FLAGS=\"-n 2\"/" \ + $CFG_FILE > ${CFG_FILE}.$$ && \ + move_file ${CFG_FILE}.$$ $CFG_FILE > /dev/null 2>&1 +fi + +rm -rf run/* > /dev/null 2>&1 + +# Fix docker-firewalld startup +mkdir -p etc/systemd/system/docker.service.d +echo "[Unit] +After=firewalld.service +" > etc/systemd/system/docker.service.d/firewalld.conf + +popd > /dev/null diff --git a/os_pre-cache b/os_pre-cache new file mode 100755 index 0000000..d8d5dff --- /dev/null +++ b/os_pre-cache @@ -0,0 +1,43 @@ +#!/bin/bash + +#sanify check + +if [ $# -lt 1 ] ; then + echo "usage $0 ROOTDIR" + exit 1 +fi + +rootdir=$1 + +if [ -z "$rootdir" ]; then + echo "ROOTDIR is not set." + exit 1 +fi + +# Check root directory +if [ ! -d $rootdir ]; then + echo "$rootdir: should be a directory." + exit 1 +fi + +pushd $rootdir > /dev/null +# Bootstrap a minimal chroot tree for the rest installation +mkdir -p var/lib/rpm +mkdir -p var/tmp +mkdir -p dev +mkdir -p run +ln -s ../run var/run + +chmod 666 dev/null + +# Make /sbin as symlink, so move the /sbin/init +mkdir -p usr/sbin +mv sbin/* usr/sbin +rm -rf sbin +ln -s usr/sbin sbin + +mkdir -p etc/sysconfig +touch etc/sysconfig/network +touch etc/fstab + +popd > /dev/null diff --git a/php_packages b/php_packages new file mode 100644 index 0000000..53a7253 --- /dev/null +++ b/php_packages @@ -0,0 +1,35 @@ +php +php-bcmath +php-dba +php-devel +php-pecl-jsonc +php-pecl-jsonc-devel +php-gd +php-imap +php-ldap +php-mbstring +php-mcrypt +php-pecl-ncurses +php-odbc +php-pear +php-snmp +php-soap +php-xml +php-xmlrpc +php-cli +php-common +php-pdo +php-pecl-zip +php-php-gettext +php-mysqlnd +php-pgsql +php-simplepie +php-IDNA_Convert +php-PHPMailer +php-process +php-enchant +php-tcpdf +php-getid3 +php-tidy +php-tcpdf-dejavu-sans-fonts +php-udan11-sql-parser \ No newline at end of file diff --git a/phpmyadmin_packages b/phpmyadmin_packages new file mode 100644 index 0000000..74f2068 --- /dev/null +++ b/phpmyadmin_packages @@ -0,0 +1 @@ +phpMyAdmin \ No newline at end of file diff --git a/phppgadmin_packages b/phppgadmin_packages new file mode 100644 index 0000000..49bc455 --- /dev/null +++ b/phppgadmin_packages @@ -0,0 +1 @@ +phpPgAdmin \ No newline at end of file diff --git a/postgresql_packages b/postgresql_packages new file mode 100644 index 0000000..57fcfd5 --- /dev/null +++ b/postgresql_packages @@ -0,0 +1,8 @@ +postgresql-server +postgresql-devel +postgresql-jdbc +postgresql-odbc +PyGreSQL +tcl-pgtcl +perl-DBD-Pg +libdbi-dbd-pgsql \ No newline at end of file diff --git a/proftpd_packages b/proftpd_packages new file mode 100644 index 0000000..0d0a16c --- /dev/null +++ b/proftpd_packages @@ -0,0 +1 @@ +proftpd \ No newline at end of file diff --git a/proftpd_post-install b/proftpd_post-install new file mode 100755 index 0000000..f22b739 --- /dev/null +++ b/proftpd_post-install @@ -0,0 +1,7 @@ +#!/bin/bash + +# Turn ports on +/usr/bin/firewall-offline-cmd --port 21:tcp > /dev/null 2>&1 +/bin/systemctl try-restart firewalld > /dev/null 2>&1 + +exit 0 diff --git a/spamassassin_packages b/spamassassin_packages new file mode 100644 index 0000000..8c99da7 --- /dev/null +++ b/spamassassin_packages @@ -0,0 +1 @@ +spamassassin diff --git a/squirrelmail_packages b/squirrelmail_packages new file mode 100644 index 0000000..b107952 --- /dev/null +++ b/squirrelmail_packages @@ -0,0 +1 @@ +squirrelmail \ No newline at end of file diff --git a/tomcat_packages b/tomcat_packages new file mode 100644 index 0000000..f85f2cf --- /dev/null +++ b/tomcat_packages @@ -0,0 +1,6 @@ +tomcat +tomcat-admin-webapps +tomcat-webapps +tomcat-lib +tomcat-el-3.0-api +tomcat-jsp-2.3-api \ No newline at end of file diff --git a/tomcat_post-install b/tomcat_post-install new file mode 100755 index 0000000..0586c82 --- /dev/null +++ b/tomcat_post-install @@ -0,0 +1,7 @@ +#!/bin/bash + +# Turn ports on +/usr/bin/firewall-offline-cmd --port 8080:tcp --port 8009:tcp > /dev/null 2>&1 +/bin/systemctl try-restart firewalld > /dev/null 2>&1 + +exit 0 diff --git a/webalizer_packages b/webalizer_packages new file mode 100644 index 0000000..d1a1943 --- /dev/null +++ b/webalizer_packages @@ -0,0 +1 @@ +webalizer \ No newline at end of file diff --git a/wordpress_packages b/wordpress_packages new file mode 100644 index 0000000..a8be288 --- /dev/null +++ b/wordpress_packages @@ -0,0 +1 @@ +wordpress \ No newline at end of file