Re: 0install system integrations

Thomas Leonard <[email protected]> Sat, 10 Jun 2017 20:10:05 +0100
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <CAG4opy9perZrya6CZCz0MqUcn60OJTo6PW6sKQ38O8+zKpEMug@mail.gmail.com>
On 2 June 2017 at 11:29, Mildred Ki'Lya <[email protected]> wrote:
> Hello,
>
> Like a previous message, I'd like to have systemd integration with 0install. Except I don't want to integrate with the user systemd daemon but with the system daemon. I want to run system services with 0install.
>
> It is already possible to create a systemd unit from scratch and invoke 0install from within. However, I'd like to distribute this systemd unit with the program itself, so it is easy to use.

Ideally, the service wouldn't provide its own unit file, as then any
service can get root on the system by e.g. changing the user it runs
as. However, writing a tool to generate safe unit files would be a bit
of work and maybe this isn't a big issue for you.

But my ideal design would be that the user does:

  0service add my-service http://...

and that generates the unit file and saves the selected versions
(selections.xml), which the service will run.

You could probably implement it as a thin layer over "0install add".

> As suggested, it would be possible to create an additional tool that can look at specific instructions in the XML feed, however there is one thing that I don't know if it is possible to do without modifying 0install itself. How about software updates?
>
> What happens when the feed contains a new version and 0install downloads it. systemd units (or anything else that deals with system integration) would have to be rewritten. Is there a way to hook into that particular moment?
>
> It's not like desktop applications where the application is not supposed to run forever. System services are constantly running and `systemctl daemon-reload` must be called, and the service restarted.
>
> How do you see we can implement that?

0service would be responsible for applying updates (e.g. with a cron
job), rather than checking at service start as desktop applications
do. That would also be useful for sandboxed services that don't have
network access.


-- 
talex5 (GitHub/Twitter)        http://roscidus.com/blog/
GPG: 5DD5 8D70 899C 454A 966D  6A51 7513 3C8F 94F6 E0CC

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot