Bug 828354 - mdadm-takeover.service not removed on uninstallation
mdadm-takeover.service not removed on uninstallation
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mdadm (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jes Sorensen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-04 12:53 EDT by Miloslav Trmač
Modified: 2013-01-17 21:11 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-11 19:53:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Miloslav Trmač 2012-06-04 12:53:37 EDT
Description of problem:
After uninstalling mdadm, a dangling symlink
> /etc/systemd/system/sysinit.target.wants/mdmonitor-takeover.service -> /usr/lib/systemd/system/mdmonitor-takeover.service
is left around, causing systemd to log
? Jun  3 05:53:01 kulicka systemd[1]: Cannot add dependency job for unit mdmonitor-takeover.service, ignoring: Unit mdmonitor-takeover.service failed to load: No such file or directory. See system logs and 'systemctl status mdmonitor-takeover.service' for details.


Version-Release number of selected component (if applicable):
mdadm-3.2.3-6.fc17.x86_64


Additional info:
The %post script adds both mdmonitor and mdmonitor-takeover services, but %preun (and %postun?) do not mention mdmonitor-takeover.
Comment 1 Jes Sorensen 2012-06-12 12:16:26 EDT
mdadm doesn't create this symlink itself, so it doesn't seem quite correct
that we remove it when the package is uninstalled. Seems to be a systemd
issue to me?

Michal?
Comment 2 Michal Schmidt 2012-06-12 14:12:09 EDT
From mdadm.spec:

%post
if [ $1 -eq 1 ] ; then
    /bin/systemctl enable mdmonitor.service mdmonitor-takeover.service >/dev/null 2>&1 || :
fi
Comment 3 Jes Sorensen 2012-06-12 14:49:44 EDT
Michal,

I see - thanks. What is the right way to disable/remove it on uninstall?

We have the following for mdmonitor.service - do I need two equivalent
lines for mdmonitor-takeoever.service?


%preun
if [ $1 = 0 ]; then
    /bin/systemctl --no-reload disable mdmonitor.service > /dev/null 2>&1 || :
    /bin/systemctl stop mdmonitor.service > /dev/null 2>&1 || :
fi

or is systemctl disable mdmonitor-takeover.service enough?

This systemctl fu is all black magic....

Thanks,
Jes
Comment 4 Michal Schmidt 2012-06-12 15:34:15 EDT
> We have the following for mdmonitor.service - do I need two equivalent
> lines for mdmonitor-takeoever.service?

The lines for mdmonitor.service look correct to me. They match the packaging guidelines:
http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd

Yes, you need to perform the same actions for mdmonitor-takeover.service.
Note that systemctl can operate on more than one unit at a time, so you don't have to add more lines to the script. You can just add mdmonitor-takeover.service to the lines you already have.

> This systemctl fu is all black magic....

These commands are no more magical than "chkconfig --del FOO" and "service FOO stop" were in SysV.
Comment 5 Jes Sorensen 2012-06-13 07:47:32 EDT
Thanks, I'll add that to the next update!

chkconfig is about the same, but I don't know that service command you
are referring to. The normal way to do things in sysv is to use
/etc/rc.d/init.d/<FOO> {stop,start,status,...}

Much easier when one can use the file system to browse things :)

Cheers,
Jes
Comment 6 Michal Schmidt 2012-06-13 09:10:11 EDT
(In reply to comment #5)
> chkconfig is about the same, but I don't know that service command you
> are referring to. The normal way to do things in sysv is to use
> /etc/rc.d/init.d/<FOO> {stop,start,status,...}

This usually worked... except in cases where it did not. /sbin/service was always the better way because at least it tried to provide a clean environment to services. (I learned about the problems of directly running initscripts in bug 588745.)
Comment 7 Fedora Update System 2012-06-26 03:15:28 EDT
mdadm-3.2.5-3.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/mdadm-3.2.5-3.fc17
Comment 8 Fedora Update System 2012-06-26 03:22:33 EDT
mdadm-3.2.5-3.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mdadm-3.2.5-3.fc16
Comment 9 Fedora Update System 2012-06-26 17:27:38 EDT
Package mdadm-3.2.5-3.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mdadm-3.2.5-3.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-9931/mdadm-3.2.5-3.fc16
then log in and leave karma (feedback).
Comment 10 Fedora Update System 2012-07-11 19:53:31 EDT
mdadm-3.2.5-3.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2012-07-11 19:57:16 EDT
mdadm-3.2.5-3.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 12 Janina Sajka 2013-01-17 21:11:23 EST
Hmmm, seems to still (or again) be a problem on F18. I have -3.2.6-11.x86_64

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