From 9656cd00341e9afbc56fa75341199ecefc6fc220 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Fri, 12 Jan 2018 13:07:41 -0500 Subject: [PATCH] Fix a bug with ejabberd and apparmor See https://bugs.launchpad.net/ubuntu/+source/ejabberd/+bug/1659801 --- templates/apt/head_apt.list | 2 +- templates/apt/reporter01_apt.list | 2 +- templates/apt/sip01_apt.list | 2 +- templates/apt/sip02_apt.list | 2 +- templates/apt/utility01_apt.list | 2 +- templates/setup-functions | 7 +++++++ templates/setup-head.sh | 5 ++++- templates/setup.sh | 3 +++ 8 files changed, 19 insertions(+), 6 deletions(-) diff --git a/templates/apt/head_apt.list b/templates/apt/head_apt.list index f0ade62..944265b 100755 --- a/templates/apt/head_apt.list +++ b/templates/apt/head_apt.list @@ -1 +1 @@ -ntp apache2 nfs-kernel-server gdebi-core nagios-nrpe-server sysstat munin-node munin-plugins-extra libwww-perl glusterfs-server glusterfs-client libapache2-mod-rpaf +ntp apache2 nfs-kernel-server gdebi-core nagios-nrpe-server sysstat munin-node munin-plugins-extra libwww-perl glusterfs-server glusterfs-client libapache2-mod-rpafi ejabberd diff --git a/templates/apt/reporter01_apt.list b/templates/apt/reporter01_apt.list index a50ebfa..16360fe 100755 --- a/templates/apt/reporter01_apt.list +++ b/templates/apt/reporter01_apt.list @@ -1 +1 @@ -ntp gdebi-core nfs-kernel-server rpcbind nagios-nrpe-server sysstat munin-node munin-plugins-extra libwww-perl libapache2-mod-rpaf +ntp gdebi-core nfs-kernel-server rpcbind nagios-nrpe-server sysstat munin-node munin-plugins-extra libwww-perl libapache2-mod-rpaf ejabberd diff --git a/templates/apt/sip01_apt.list b/templates/apt/sip01_apt.list index 00592ec..2b02002 100755 --- a/templates/apt/sip01_apt.list +++ b/templates/apt/sip01_apt.list @@ -1 +1 @@ -ntp apache2 nfs-kernel-server gdebi-core nagios-nrpe-server sysstat munin-node munin-plugins-extra libwww-perl +ntp apache2 nfs-kernel-server gdebi-core nagios-nrpe-server sysstat munin-node munin-plugins-extra libwww-perl ejabberd diff --git a/templates/apt/sip02_apt.list b/templates/apt/sip02_apt.list index 00592ec..2b02002 100755 --- a/templates/apt/sip02_apt.list +++ b/templates/apt/sip02_apt.list @@ -1 +1 @@ -ntp apache2 nfs-kernel-server gdebi-core nagios-nrpe-server sysstat munin-node munin-plugins-extra libwww-perl +ntp apache2 nfs-kernel-server gdebi-core nagios-nrpe-server sysstat munin-node munin-plugins-extra libwww-perl ejabberd diff --git a/templates/apt/utility01_apt.list b/templates/apt/utility01_apt.list index eb81dad..7d0ba4e 100755 --- a/templates/apt/utility01_apt.list +++ b/templates/apt/utility01_apt.list @@ -1 +1 @@ -ntp apache2 nfs-kernel-server rpcbind gdebi-core nagios-nrpe-server sysstat munin-node munin-plugins-extra libwww-perl libapache2-mod-rpaf +ntp apache2 nfs-kernel-server rpcbind gdebi-core nagios-nrpe-server sysstat munin-node munin-plugins-extra libwww-perl libapache2-mod-rpaf ejabberd diff --git a/templates/setup-functions b/templates/setup-functions index 3c46084..f08f5f5 100755 --- a/templates/setup-functions +++ b/templates/setup-functions @@ -120,6 +120,13 @@ else fi } +FixAppArmorEJabberD () { ## workaround for bug in ejabberd/apparmor +if [ -e /etc/apparmor.d/usr.sbin.ejabberdctl ]; then + sed -i 's^\s/bin/su\s*r^\t/bin/su\t\t\t\t\trm^' /etc/apparmor.d/usr.sbin.ejabberdctl + systemctl restart apparmor.service +fi +} + ConfigNetwork () { PRIMARY_IF=$(ip route get 8.8.8.8 | awk '{print $5; exit}') if [ ! -z "$PRIMARY_IF" ]; then diff --git a/templates/setup-head.sh b/templates/setup-head.sh index a79b437..dc9658b 100755 --- a/templates/setup-head.sh +++ b/templates/setup-head.sh @@ -106,6 +106,9 @@ if [ -e head_file_apt.list ] $APT_TOOL update && $APT_TOOL -y install $(cat head_file_apt.list) fi +### Fix ejabberd/apparmor bug +FixAppArmorEJabberD + ### Install Opensrf and Evergreen debs. if [ -e debconf-settings ] then @@ -198,7 +201,7 @@ sed -i 's/APACHE_RUN_USER=www-data/APACHE_RUN_USER=opensrf/g' /etc/apache2/envva ### shutdown apache2 echo;echo "Stopping apache2 to setup nginx...";sleep 3 -service apache2 stop +systemctl stop apache2 ### Install nginx $APT_TOOL install -y nginx diff --git a/templates/setup.sh b/templates/setup.sh index 741ba07..482ed9f 100755 --- a/templates/setup.sh +++ b/templates/setup.sh @@ -189,6 +189,9 @@ if [ -e tar_file_apt.list ] $APT_TOOL -y install $(cat tar_file_apt.list) 2>&1 | tee -a "$INSTALL_LOG" fi +### Fix ejabberd/apparmor bug +FixAppArmorEJabberD + PG_Deps_Warning () { ### Dependency install error message echo echo "*********" -- 2.11.0