MOON
Server: Apache
System: Linux vps.erhabenn.com.br 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User: machen (1008)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //opt/microsoft/omsagent/tst/files/datafiles/linux_rpm.data
%Variables
PERFORMING_UPGRADE_NOT: '[ "$1" -ne 1 ]'
PACKAGE_TYPE: 'RPM'
SEPKG_DIR_OMSAGENT: '/usr/share/selinux/packages/omsagent-logrotate'

%Dependencies
omi >= 1.3.0-2
scx >= 1.6.3-212

%Files
${{SEPKG_DIR_OMSAGENT}}/omsagent-logrotate.fc;                       installer/selinux/omsagent-logrotate.fc;                                 644; root; root
${{SEPKG_DIR_OMSAGENT}}/omsagent-logrotate.te;                       installer/selinux/omsagent-logrotate.te;                                 644; root; root
${{SEPKG_DIR_OMSAGENT}}/omsagent-logrotate.el6.te;                   installer/selinux/omsagent-logrotate.el6.te;                             644; root; root
${{SEPKG_DIR_OMSAGENT}}/omsagent-logrotate.pp;                       intermediate/${{BUILD_CONFIGURATION}}/selinux/omsagent-logrotate.pp;     755; root; root
${{SEPKG_DIR_OMSAGENT}}/omsagent-logrotate.el6.pp;                   intermediate/${{BUILD_CONFIGURATION}}/selinux.el6/omsagent-logrotate.pp; 755; root; root

/opt/microsoft/omsagent/plugin/VMInsightsDataCollector.rb;              source/code/plugins/VMInsightsDataCollector.rb;        744; root; root; conffile
/opt/microsoft/omsagent/plugin/changetracking_lib.rb;                   source/code/plugins/changetracking_lib.rb;             744; root; root; conffile
/opt/microsoft/omsagent/plugin/filter_patch_management.rb;              source/code/plugins/filter_patch_management.rb;        744; root; root; conffile
/opt/microsoft/omsagent/plugin/out_oms_changetracking_file.rb;          source/code/plugins/out_oms_changetracking_file.rb;    744; root; root; conffile
/opt/microsoft/omsagent/plugin/patch_management_lib.rb;                 source/code/plugins/patch_management_lib.rb;           744; root; root; conffile

%Directories
/usr/share/selinux/packages;                                         755; root; root; sysdir
/usr/share/selinux/packages/omsagent-logrotate;                      755; root; root

%Postinstall_550
if [ -e /usr/sbin/semodule ]; then
    echo "System appears to have SELinux installed, attempting to install selinux policy module for logrotate"

    SUCCESS=0
    for POLICY_FILE in ${{SEPKG_DIR_OMSAGENT}}/omsagent-logrotate.pp ${{SEPKG_DIR_OMSAGENT}}/omsagent-logrotate.el6.pp; do
        echo "  Trying ${POLICY_FILE} ..."
        /usr/sbin/semodule -i ${POLICY_FILE} >/dev/null 2>&1
        if [ $? -eq 0 ]; then
            SUCCESS=1
            break
        fi
    done

    if [ $SUCCESS -eq 0 ]; then
        echo "ERROR: None of the available omsagent-logrotate selinux policy module versions could be installed"
        exit 0
    fi

    # Labeling omsagent log files 
    /sbin/restorecon -R /var/opt/microsoft/omsagent/*/log > /dev/null 2>&1
fi

%Postuninstall_5
if [ -e /usr/sbin/semodule ]; then
    if [ ! -z "$(/usr/sbin/semodule -l | grep omsagent-logrotate)" ]; then
        echo "Removing selinux policy module for omsagent-logrotate ..."
        /usr/sbin/semodule -r omsagent-logrotate
    fi
fi