[0/2] Fix Bug#12935 - status info broken on services.cgi for some addons

Message ID 20221003152720.13140-1-robin.roevens@disroot.org
Headers
Series Fix Bug#12935 - status info broken on services.cgi for some addons |

Message

Robin Roevens Oct. 3, 2022, 3:27 p.m. UTC
  Hi all

This patchset fixes Bug#12935
(https://bugzilla.ipfire.org/show_bug.cgi?id=12935)

Summary:
Addons where the initscript does not match the addon-name and addons with
multiple initscripts are now listed on services.cgi since CU170.
But addonctrl still expected addon name to be equal to
initscript name; Hence starting/stopping/enabling/disabling of such
addons was not possible.
This has always been like that, but that problem was hidden as
services.cgi also did not display those addon services.

After discussing this with Adolf on the Bug report, we concluded that we
should adapt addonctrl to work with the new addon metadata
Services-field instead.

I basically rewrote addonctrl to not only use the new services metadata
but also to have better errorchecking and added the posibility to check
if a service is currently enabled or disabled.
As a result services.cgi no longer has to go checking the precense of
runlevel initscripts, but can just ask addonctrl.
I also added a warning to services.cgi if a runlevel initscript does not
exists, to prevent the user from wondering why he can't enable a
specific service. (Adolf pointed out some services don't install
runlevel initscripts by default)

More details in the bugreport and in the commit-messages of the patches.

Regards
Robin

GIT: [PATCH 1/2] misc-progs: addonctrl: Add support for 'Services'
GIT: [PATCH 2/2] services.cgi: Fix status/actions on services with name !=