Bug 714830
Summary: | No equivalent of --initscript parameter to /usr/sbin/alternatives when using systemd instead of an /etc/init.d script | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Sam Varshavchik <mrsam> | ||||||
Component: | chkconfig | Assignee: | Bill Nottingham <notting> | ||||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 15 | CC: | jskarvad, k.georgiou, notting, rvokal | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 723679 (view as bug list) | Environment: | |||||||
Last Closed: | 2011-07-20 19:33:23 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Sam Varshavchik
2011-06-20 22:44:33 UTC
I started looking at this today. The big issue is that the --initscript argument today works in terms of 'chkconfig --add' and 'chkconfig --del', where it removes/adds all the start/stop links entirely. There's not a direct analog here, so it's not a trivial fix - might require some changes to its semantics. The test patch appears to be a CNN article... That's a neat trick. Will fix. Created attachment 513448 [details]
test patch
Does not work. A watchpoint shows isSystemd that gets initialized by the patch subsequently gets clobbered by line 595: /* Insert new set into the set of alternatives */ for (i = 0 ; i < set.numAlts ; i++) { if (!strcmp(set.alts[i].master.target, newAlt.master.target)) { ====> set.alts[i] = newAlt; break; } What is it doing for you if you pass --verbose? It seems to be working for me. Oh, never mind. --set works, the initial install doesn't. Created attachment 513882 [details]
better patch
Here's a better patch that works for me, and will be in the next rawhide build; it just leaves the determination of whether to call systemctl to when it actually performs the action.
Gave the new patch a spin. Seems to work, except for one thing. --remove does not run "systemctl disable". The alternatives symlink gets removed, but the systemd service does not get disabled. For me, --install runs "systemctl enable", but --remove does not run "systemctl disable". This seems to be inconsistent. That's not a regression, though. If I recall, the idea is that that is done in the package's scripts on uninstallation. But, presumably, so would be on installation too. Since chkconfig does not support systemd at all, I don't see what's here to regress. But this is an opportunity to make things more consistent. It seems more consistent to me that if chkconfig enables the service on install, it should also disable it on uninstall. Or, do not enable or disable on install and uninstall at all; make it the package's responsibility, to enable and disable its service, in addition to installing and uninstalling an alternatives links; and chkconfig only invokes systemctl when switching to a new alternative. I've cloned this bug for that issue (bug 723679); setting this one as CLOSED->RAWHIDE. |