Web lists-archives.com

Re: Systemd user instance equivalent of dh_systemd_enable?

Hi Daniele!

On 08/04/18 02:18, Daniele Nicolodi wrote:
> Hello,
> I'm working on a package that installs a systemd user instance unit file
> that needs to be enabled with
> # systemctl --global enable foo.service
> Using debhelper, dh_systemd_enable takes care of this automatically for
> system unit files, but not for user unit files.  Is there some other
> (semi)automatic way of doing it or should I take care of it manually in
> the postinst and prerm maintainer scripts?

I'm no mentor. That said, my immediate reaction is that you cannot
really do this at package installation. systemd --user services are
managed by individual users, and the package can only prepare so that
users can enable their services.

For example:  what happens if a new user is added after the package is

A good package should support their users doing this, at a minimum in
documentation, still better with  some tooling to set it up properly.
Not all users are comfortable using systemctl --user, and some help is
certainly appreciated.