[systemd-devel] Does user timer start at boot?
Lennart Poettering
lennart at poettering.net
Tue Oct 2 15:57:49 UTC 2018
On Di, 02.10.18 17:40, Kamil Jońca (kjonca at o2.pl) wrote:
> Lennart Poettering <mzerqung at 0pointer.de> writes:
>
> > On Di, 02.10.18 17:14, Kamil Jońca (kjonca at o2.pl) wrote:
> >
> >> So I cannot run ONLY user timers?
> >> (IE i have some services which I want only on user login, but I want to
> >> use timers at boot?)
> >
> > Well, depends how you login happens. I think it would be wise for
> > graphical DEs to enqueue some target as soon as a graphical login
> > actually happens, i.e. gnome-session should probably start
> > "gnome.target" or so, when an actual login happens, and then you could
> > hook into that.
> >
>
> I think about little different situation.
>
> I have some user timers.
> I boot machine and I want these timers started, without user login or so.
> A ... day after I log in to machine
> And I want rest of user services started.
> As I understand it is impossible with systemd?
Well, depends on how precisely you "log in". If you'd use a DE that
pulls in a target on each new session then you'd get what you are
looking for (as suggested above). But if you don't then no, there's no
generic hook defined that allows you to start something based on
whether there is a session or not that'd work for all kinds of
sessions.
If you are interested in text sessions, then bash (or whatever you use
as shell) is the sesion manager, and that doesn't invoke such a target
either. That said, you could add "systemctl --user --no-block start
tty-login.target" or so to your .profile and then hook into that
target.
But no, there is no generic solution for this. Sorry.
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list