[systemd-devel] systemd user unit - how to prepare environment?
Lennart Poettering
lennart at poettering.net
Wed Sep 12 09:32:31 UTC 2018
On Mi, 12.09.18 17:28, Peter Hoeg (peter at hoeg.com) wrote:
> > > How does this compare to man 5 environment.d ?
> >
> > You can use that too. Difference is mainly that user.conf is what
> > systemd itself reads.
>
> So you are saying that DefaultEnvironment in user.conf will read
> immediately and therefore all services started by systemd will see
> that but since environment.d is processed by a generator, it might
> run later and therefore not all systemd started services will have
> the variables set? Or am I misunderstanding it?
No, the generators are also run early.
The effect is really the same. I just like to keep things tight:
user.conf is read by the systemd binary itself while the environment
generator stuff is one more component that has to be involved. If it
doesn't matter to you I'd stick it into user.conf and not involve the
additional components needlessly...
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list