Mini Shell

Direktori : /usr/share/cagefs/scriptlets/
Upload File :
Current File : //usr/share/cagefs/scriptlets/rpm_post.sh

#!/usr/bin/bash
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

# Note: Also called from Debian
# Arguments:

# RPM
# $1 == 1 - install package
# $1 == 2 - upgrade package

# DEB
# $1 == configure - RPM post/posttrans

rhel=$2           # 0%{?rhel}

rm -f /usr/share/cagefs/need.remount

# This operations will remove older version of socket (from syslog/rsyslog)
# if server has systemd-journal and uses its socket.
# In other cases it just add /usr/share/cagefs-skeleton/dev/log to
# syslog/rsyslog config and restart service.
/usr/share/cagefs-plugins/install-cagefs-plugin.py --add-syslog-socket

# installation of the package ?
if [[ "$1" == 1 || "$1" == "install" ]]; then
    # CAG-1039: make /dev/shm isolated by default for new cagefs installations
    if [ ! -e /etc/cagefs/dev.shm.options ]; then
        echo 'mode=0777' > /etc/cagefs/dev.shm.options
    fi
    touch /usr/share/cagefs/need.remount
    #configure LiteSpeed on cagefs install
    /usr/sbin/cagefsctl --configure-litespeed

    # enable CageFS features
    if [[ "$rhel" -ge 7 ]]; then
        /usr/share/cagefs/feature_manager.py enable --dbus-hardening
    fi
else
    # upgrade of the package
    touch /usr/share/cagefs/skip.cagefs.restart
fi

if [[ $rhel -gt 6 ]]; then
  systemctl enable proxyexecd.service >/dev/null 2>&1
  systemctl enable cagefs.service >/dev/null 2>&1
else
  /sbin/chkconfig --add cagefs
  /sbin/chkconfig --add proxyexecd
  /sbin/chkconfig --level 235 proxyexecd on
fi

exit 0

Zerion Mini Shell 1.0