Discussion:
[systemd-devel] systemctl --user on RHEL -- is this a bad idea
Jeff Solomon
2017-11-08 01:33:50 UTC
Permalink
Hi,

I would like to use a user service (systemctl --user) with systemd on RHEL7
where it has been deliberately removed.

I've communicated with the RH dev who made this change who reported that I
could restore the /lib/systemd/system/***@.service file and mostly
everything would work.

I don't care about having the user service exist only when the user is
logged in, as I will enable lingering on the service and I want it to be
running from boot to shutdown.

I've found that I can run:

systemctl start ***@foo

to start the foo user's service and that works, but on other systems
(Ubuntu) where user services are officially supported, the user service is
automatically started when I run:

loginctl enable-linger foo

whereas on RHEL, running this command does not start the service.

I can imagine writing a tiny additional service on RHEL that will start the
user service using:

ExecStart=/usr/bin/systemctl start ***@foo

but I'd rather make lingering officially work on RHEL to the extent that
that is possible.

Two questions:

1) Any idea how to make lingering work such that the user service is
started automatically on reboot

2) Is it a really dumb idea to try to make this work on RHEL7?

Thanks!

Jeff
Michael Chapman
2017-11-08 07:01:23 UTC
Permalink
Post by Jeff Solomon
Hi,
I would like to use a user service (systemctl --user) with systemd on RHEL7
where it has been deliberately removed.
I've communicated with the RH dev who made this change who reported that I
everything would work.
I've been dropping 0004-remove-user-.service.patch from RHEL's systemd
packages since RHEL 7.2, when Red Hat bumped systemd up from v208 to v219.
I haven't encountered any problems with this change.
Jeff Solomon
2017-11-08 15:36:39 UTC
Permalink
Hi Michael,

Good to know. Do you count on lingering or on starting the user service on first login?
Post by Jeff Solomon
Hi,
I would like to use a user service (systemctl --user) with systemd on RHEL7
where it has been deliberately removed.
I've communicated with the RH dev who made this change who reported that I
everything would work.
I've been dropping 0004-remove-user-.service.patch from RHEL's systemd packages since RHEL 7.2, when Red Hat bumped systemd up from v208 to v219. I haven't encountered any problems with this change.
Michael Chapman
2017-11-08 19:11:56 UTC
Permalink
Post by Jeff Solomon
Hi Michael,
Good to know. Do you count on lingering or on starting the user service on first login?
Well, both work, but the main reason I've made this change is so that I
can enable lingering on users and run persistent user-specific services.
Loading...