public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Adolf Belka <adolf.belka@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH 0/3] Pakfile metadata enhancements
Date: Sat, 15 May 2021 14:10:56 +0200	[thread overview]
Message-ID: <a8f1155a-586d-644e-dbaf-6d24b6b9f7a8@ipfire.org> (raw)
In-Reply-To: <b5b91757c6bb91dc088ec72d59c2b1a6987701af.camel@disroot.org>

[-- Attachment #1: Type: text/plain, Size: 9973 bytes --]

Hi Robin,

On 13/05/2021 00:31, Robin Roevens wrote:
> Hi Jonatan
>
> Jonatan Schlag schreef op wo 12-05-2021 om 20:45 [+0200]:
>> Hi,
>>
>>> Am 23.04.2021 um 18:16 schrieb Robin Roevens <
>>> robin.roevens(a)disroot.org>:
>>>
>>> Hi folks
>>>
>>> During my discussion with Michael in the zabbix_agentd patchset
>>> thread
>>> about knowing what addon services should be running or not, it came
>>> up
>>> that it would be handy for several reasons if we had a bit more
>>> metadata
>>> for pak-files as we currently have. Mostly knowing which services
>>> (initscripts) are installed by a pak-file.
>>> This would allow for services.cgi to not have to manually try to find
>>> out if an installed addon actually has an initscript or not.
>>> Also paks like libvirt install 2 initscripts, those can now both be
>>> displayed on the services.cgi page.
>>> Idem for monitoring agents, which was my main objective.
>>>
>>> So here is an attempt to achieve this. This is not yet a patchset to
>>> be applied yet, but rather a proposal as this change would require
>>> all
>>> addon LFS-files to be changed.  But I didn't want to do that yet as
>>> this patchset may very wel be rejected completely :-).
>>> The first patch introduces 2 new macro's:
>> So it could be done in two separate patches or even better patch sets.
>> Makes reviewing easier and patches shorter :-)
>>> - SUMMARY for a short, one-line summary of the package
>>> - INITSCRIPTS for a space seperated list of initscripts provided by
>>> the
>>>   package.
>> How it is supposed to be handled when a package (like libvirt) install
>> its own init scripts? So not a initscript we have in our source, but
>> which is delivered in the source of the package itself. If we put this
>> in the list, the macro will break. If we leave it out we lose
>> information.
>>
> You have a point there. In the case of libvirt it, as you point out in
> your other mail, is indeed an initscript that does not start a service
> so does not pose a problem using this method.
> But it is not unthinkable that another pak (or a possible future pak)
> includes an initscript in the source itself.
> So this is may indeed be something to take into account..
>
>> Do you did some research how other distribution handle this problem?
>> ( If they handle it at all.)
> "normal" distributions generally don't really care which packages run
> which services and if/or those are actually services.
> However most modern distro's use systemd making it easier to know which
> units are services, and which are so called one-shots as you can just
> ask systemd. It has a lot more info about all "initscripts" which would
> make this task easier. But we don't have systemd here :-)
>
> Also Zabbix monitoring agent for example has no built-in methods to
> automatically discover available and/or running services when the
> monitored distro is not running systemd. While it already does this for
> decades for Windows hosts. And more recently also for systemd.
>
> In Suse, each package containing a service also created a link
> /usr/sbin/rc<servicename> which links to the 'service' command which
> currently is a wrapper script to systemd. Not sure how they did it
> before systemd, possibly those rc-binaries where just symlinks to the
> actual initscripts.
> That is maybe something we may also need to consider, but then rather
> for better user cli experience as I don't immediately see that solving
> the problem you posed.
>
>> Another approach which comes to my mind:
>> Why not parsing the root file for /etc/rc.d/init.d/ (I currently do not
>> know if it is the right path)? So trying to detect which initscripts
>> are part of the root file?
>>
> As you concluded in your other mail, not all initscripts are
> services/daemons so that would probably require some hardcoded
> exceptions and alike. Which is exactly what we are trying to avoid and
> is currently done in services.cgi. :-)
>
> To tackle the problem with service-initscripts included in and
> installed by the source in my approach; I currently see 2 possible
> solutions:
>
> - also provide the old INSTALL_INITSCRIPT macro to manually install one
> or more initscripts, so you are able to skip initscripts listed in
> INITSCRIPTS but which are installed by the source.
>
> - make it a common practice to prevent the source from installing an
> initscript, extracting it and installing it the IPFire way. (I think
> initscript investigation is probably required anyway to make sure it is
> compatible on IPFire..)

I don't believe that a source automatically installing an initscript is something I have ever come across. As the package is from source then the package has limited idea on what initscript system (System V, systemd, upstart etc) is being used and what the locations for the scripts should be.

The closest I have come is the bacula source file which also has a range of different startup options available which it can choose based on the distro it detects but the user has to specifically run make install-autostart in the build after make install, so it doesn't happen automatically, you have to choose to do it.

So I think you shouldn't have to worry about auto installation of initscripts.

Regards,

Adolf.

>
>>> And an alternative INSTALL_INITSCRIPTS method instead of the
>>> current
>>> INSTALL_INITSCRIPT method. As we now have all initscripts in the
>>> INITSCRIPTS macro, the INSTALL_INITSCRIPTS will install all
>>> initscripts
>>> listed in that macro, so a simple call to INSTALL_INITSCRIPTS will
>>> now
>>> do the job instead of multiple calls in case of multiple
>>> initscripts
>>> (for example libvirt. I noticed clamav actually uses 1 initscript
>>> for
>>> starting 2 services, this could maybe also be split up again)
>>> I included 2 examples in the first patch: libvirt and
>>> zabbix_agentd. But
>>> when implemented ofcourse all makefiles should be updated.
>>>
>>> During the pak packaging process in the build procedure, those new
>>> macro's will be inheritted in the generated pakfire meta-* files.
>>>
>>> The second patch adds an extra 'info <pak(s)>' commandline
>>> parameter to
>>> pakfire, which will in turn call a new Pakfire::pakinfo function.
>>> This function wil parse the meta-* file of the requested pak and
>>> functions in 2 modes:
>>> - "latest" which is the behaviour of the info parameter. This will
>>>   display the latest available metadata of the pak and the status of
>>>   the pak on the system as in: is it installed?, and if so, is it
>>>   up-to-date.
>>> - "installed" wich will display only information about the
>>> currently
>>>   installed pak and bail out of the requested pak is not currently
>>>   installed.
>>> This function was added to provide a 'central' point/method to get
>>> pak
>>> information. I don't know if there are other scripts beside
>>> services.cgi
>>> that currently try parsing meta-* files. But they should then be
>>> changed
>>> to use this function instead.
>>>
>>> Example output of the new pakfire info command: `pakfire info
>>> zabbix_agentd`:
>>> when installed and up-to-date:
>>> ---
>>> Name: zabbix_agentd
>>> Version: 4.2.6-4
>>> Summary: Zabbix Agent
>>> Size: 250.00 KB
>>> Dependencies:
>>> Pakfile: zabbix_agentd-4.2.6-4.ipfire
>>> InitScripts: zabbix_agentd
>>> Installed: Yes
>>> Status: up-to-date
>>> ---
>>> When an update is available:
>>> ---
>>> Name: zabbix_agentd
>>> Version: 5.0.10-5
>>> Summary: Zabbix Agent
>>> Size: 276.00 KB
>>> Dependencies: fping
>>> Pakfile: zabbix_agentd-5.0.10-5.ipfire
>>> InitScripts: zabbix_agentd
>>> Installed: Yes
>>> Status: outdated (version 4.2.6-4 is installed)
>>> ---
>>> Or when a pak was discontinued and no longer supplied by ipfire,
>>> but
>>> still installed on the system:
>>> ---
>>> Name: zabbix_agentd
>>> Version: -
>>> Summary: Zabbix Agent
>>> Size: 250.00 KB
>>> Dependencies:
>>> Pakfile: zabbix_agentd-4.2.6-4.ipfire
>>> InitScripts: zabbix_agentd
>>> Installed: Yes
>>> Status: obsolete (version 4.2.6-4 is installed)
>>> ---
>>> and at last when a pak is available, but not installed:
>>> ---
>>> Name: zabbix_agentd
>>> Version: 5.0.10-5
>>> Summary: Zabbix Agent
>>> Size: 276.00 KB
>>> Dependencies: fping
>>> Pakfile: zabbix_agentd-5.0.10-5.ipfire
>>> InitScripts: zabbix_agentd
>>> Installed: No
>>> Status: not installed
>>> ---
>>>
>>> And then the last patch is an update of service.cgi now using the
>>> new
>>> Pakfire::pakinfo function in "installed"-mode.
>>>
>>> If there are any suggestions on more metadata.. I think this is the
>>> moment to throw them at me.
>>> And ofcourse suggestions/comments are welcome as this is currently
>>> only
>>> a proposal for change. But I think we win in robustness of
>>> services.cgi
>>> and user experience in both using pakfire and ability to provide
>>> available services to monitoring agents.
>> Just want to say thank you for taking this way, which might be
>> “harder” but yields better result from my experience. Please do not
>> take my points as “this is not right”, more like “there might me
>> other ways, are they better?”.
>>
> That is exactly why I threw this in the group; to check if there are
> better idea's/approaches/things I overlooked/..
> So thank you for your constructive comments!
>
> Regards
> Robin
>
>> Greetings Jonatan
>>> On top of that could the whole meta-* files system be overhauled in
>>> the
>>> future, if wanted, with only pakfire itself needing change as the
>>> rest
>>> will then depend on pakfire for correctly parsing it's "database".
>>>
>>>
>>> Regards
>>> Robin
>>>
>>>
>>>
>>> -- 
>>> Dit bericht is gescanned op virussen en andere gevaarlijke
>>> inhoud door MailScanner en lijkt schoon te zijn.
>>>
>

      reply	other threads:[~2021-05-15 12:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 16:15 Robin Roevens
2021-04-23 16:15 ` [PATCH 1/3] buildprocess: Add extra metadata to meta-* files Robin Roevens
2021-05-12 18:49   ` Jonatan Schlag
2021-05-14 12:24     ` Michael Tremer
2021-05-14 20:07       ` Robin Roevens
2021-05-18 15:09         ` Michael Tremer
2021-05-24 20:23           ` Robin Roevens
2021-06-06 18:41             ` Robin Roevens
2021-06-10 11:27               ` Michael Tremer
2021-06-17 22:28                 ` Robin Roevens
2021-06-18  8:32                   ` Michael Tremer
2021-06-10 11:24             ` Michael Tremer
2021-05-14 12:23   ` Michael Tremer
2021-05-14 20:16     ` Robin Roevens
2021-05-18 11:12       ` Michael Tremer
2021-04-23 16:15 ` [PATCH 2/3] pakfire: add 'info <pak(s)>' option Robin Roevens
2021-05-13  8:02   ` Jonatan Schlag
2021-05-13 19:11     ` Robin Roevens
2021-05-14 12:19       ` Michael Tremer
2021-05-14 20:24         ` Robin Roevens
2021-05-25 11:22           ` Michael Tremer
2021-04-23 16:15 ` [PATCH 3/3] services.cgi: use new Pakfire::pakinfo function Robin Roevens
2021-05-11 19:30 ` group call for review/opinions/idea's (was: [PATCH 0/3] Pakfile metadata enhancements) Robin Roevens
2021-05-12 18:45 ` [PATCH 0/3] Pakfile metadata enhancements Jonatan Schlag
2021-05-12 22:31   ` Robin Roevens
2021-05-15 12:10     ` Adolf Belka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a8f1155a-586d-644e-dbaf-6d24b6b9f7a8@ipfire.org \
    --to=adolf.belka@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox