Bug 19527 - dangling link + scriptlet failed with current audit package
Summary: dangling link + scriptlet failed with current audit package
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Shlomi Fish
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-04 14:52 CEST by David GEIGER
Modified: 2016-10-06 09:57 CEST (History)
1 user (show)

See Also:
Source RPM: audit-2.6.7-1.mga6.src.rpm
CVE:
Status comment:


Attachments
patch to fix audit issue (2.00 KB, patch)
2016-10-05 14:23 CEST, David GEIGER
Details | Diff

Description David GEIGER 2016-10-04 14:52:15 CEST
Hi,

Current audit has a dangling link and a scriplet failed when uninstalling the package, see the following console output procedure:

## Install:

# LC_ALL=C urpmi audit

    $MIRRORLIST: media/core/release/audit-2.6.7-1.mga6.x86_64.rpm
installing audit-2.6.7-1.mga6.x86_64.rpm from /var/cache/urpmi/rpms                                                     
Preparing...                     ######################################################################################
      1/1: audit                 ######################################################################################
Created symlink /etc/systemd/system/multi-user.target.wants/auditd.service -> /usr/lib/systemd/system/auditd.service.


## Uninstall:

# LC_ALL=C urpme audit
removing audit-2.6.7-1.mga6.x86_64
removing package audit-2.6.7-1.mga6.x86_64
      1/1: removing audit-2.6.7-1.mga6.x86_64
                                 ######################################################################################
Failed to disable unit: No such file or directory
Failed to stop auditd.service: Operation refused, unit auditd.service may be requested by dependency only.
See system logs and 'systemctl status auditd.service' for details.
warning: %postun(audit-2.6.7-1.mga6.x86_64) scriptlet failed, exit status 4
ERROR: 'script' failed for audit-2.6.7-1.mga6.x86_64
#


## Search dangling link:

$ symlinks -r / |grep dangling |grep audit
dangling: /etc/systemd/system/multi-user.target.wants/auditd.service -> /usr/lib/systemd/system/auditd.service
Comment 1 David Walser 2016-10-05 14:04:01 CEST
Probably just changing %postun to %preun in the SPEC will fix the issues reported in this bug.

Why we aren't just using our normal macros I don't now, but the comments suggest our helper scripts might need some adjustments.

We have:
%post
# Copy default rules into place on new installation
files=`ls /etc/audit/rules.d/ 2>/dev/null | wc -w`
if [ "$files" -eq 0 ] ; then
# audit off by default, rhbz#1117953
        cp /usr/share/doc/audit/rules/10-no-audit.rules /etc/audit/rules.d/audit
.rules
fi

%_tmpfilescreate %{name}

## This hack is because the auditd.service needs to be started before sysinit.ta
rget. So let's just enable and start
## the service manually after installation. This needs to be revisited after our
 %%_post_service has been adjusted
systemctl enable -q auditd.service
systemctl start -q auditd.service
# %%_post_service auditd.service

%postun
systemctl disable -q auditd.service
systemctl stop -q auditd.service

CC: (none) => mageia

Comment 2 David GEIGER 2016-10-05 14:23:46 CEST
Created attachment 8491 [details]
patch to fix audit issue

So with attached patch the two issues are fixed.

Just I don't know why "systemctl stop" service doesn't work with audit??
Comment 3 David GEIGER 2016-10-06 09:57:49 CEST
Fixed with audit-2.6.7-2.mga6

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.