Discussion:
Systemd dependencies
(too old to reply)
Boyce, Kevin P [US] (AS)
2018-12-10 20:26:39 UTC
Permalink
I seem to be struggling with what should be a very basic operation. I've seen similar questions posted to the list here and none of them are really adequate.

I'm trying to prompt the user to ask a question as the system is coming up (so the system can configure it's network and other things based on a hostname the user enters).

I have this part working using system-ask-password which is executed using a oneshot/idle service unit. However before the user can enter their response on the console the graphic display starts up. In the unit file I've tried all sorts of combinations of Requires, After, WantedBy, RequiredBy, etc. to make the graphical.target happen only after this script has completed its execution to no avail.

Any help would be appreciated. I've thought of creating a new custom target and putting my service in it. Is there a way to force another target not to start until another target is completely finished?

Just wondering why this sort of operation is so hard.

Thanks,
Kevin
Reindl Harald
2018-12-10 20:42:00 UTC
Permalink
I seem to be struggling with what should be a very basic operation. 
I’ve seen similar questions posted to the list here and none of them are
really adequate.
I’m trying to prompt the user to ask a question as the system is coming
up (so the system can configure it’s network and other things based on a
hostname the user enters).
I have this part working using system-ask-password which is executed
using a oneshot/idle service unit.  However before the user can enter
their response on the console the graphic display starts up.  In the
unit file I’ve tried all sorts of combinations of Requires, After,
WantedBy, RequiredBy, etc. to make the graphical.target happen only
after this script has completed its execution to no avail.
Any help would be appreciated.  I’ve thought of creating a new custom
target and putting my service in it.  Is there a way to force another
target not to start until another target is completely finished?
Just wondering why this sort of operation is so hard.
because you likely have some "Type=simple" stuff instead foking/notify
which don't ait for anything in your chain and no additional targets can
fix that
Boyce, Kevin P [US] (AS)
2018-12-10 21:06:56 UTC
Permalink
I'm sure Redhat has implemented some services of type Simple.

However, my service is oneshot, and what you're saying is there's no way for me to force any other service to wait until my service exits before bootup continues?

This doesn't seem right given that systemd can wait for a password to unlock encrypted volumes.

Kevin

-----Original Message-----
From: systemd-devel <systemd-devel-***@lists.freedesktop.org> On Behalf Of Reindl Harald
Sent: Monday, December 10, 2018 3:42 PM
To: systemd-***@lists.freedesktop.org
Subject: EXT :Re: [systemd-devel] Systemd dependencies
Post by Boyce, Kevin P [US] (AS)
I seem to be struggling with what should be a very basic operation.
I’ve seen similar questions posted to the list here and none of them
are really adequate.
I’m trying to prompt the user to ask a question as the system is
coming up (so the system can configure it’s network and other things
based on a hostname the user enters).
I have this part working using system-ask-password which is executed
using a oneshot/idle service unit.  However before the user can enter
their response on the console the graphic display starts up.  In the
unit file I’ve tried all sorts of combinations of Requires, After,
WantedBy, RequiredBy, etc. to make the graphical.target happen only
after this script has completed its execution to no avail.
Any help would be appreciated.  I’ve thought of creating a new custom
target and putting my service in it.  Is there a way to force another
target not to start until another target is completely finished?
Just wondering why this sort of operation is so hard.
because you likely have some "Type=simple" stuff instead foking/notify which don't ait for anything in your chain and no additional targets can fix that _______________________________________________
systemd-devel mailing list
systemd-***@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Reindl Harald
2018-12-10 21:12:21 UTC
Permalink
Post by Boyce, Kevin P [US] (AS)
I'm sure Redhat has implemented some services of type Simple.
However, my service is oneshot, and what you're saying is there's no way for me to force any other service to wait until my service exits before bootup continues?
Type=oneshot waits
what about posting service definitions instead of "to guess" text?
Andrei Borzenkov
2018-12-11 04:38:56 UTC
Permalink
Post by Boyce, Kevin P [US] (AS)
I seem to be struggling with what should be a very basic operation. I've seen similar questions posted to the list here and none of them are really adequate.
I'm trying to prompt the user to ask a question as the system is coming up (so the system can configure it's network and other things based on a hostname the user enters).
I have this part working using system-ask-password which is executed using a oneshot/idle service unit. However before the user can enter their response on the console the graphic display starts up. In the unit file I've tried all sorts of combinations of Requires, After, WantedBy, RequiredBy, etc. to make the graphical.target happen only after this script has completed its execution to no avail.
Delaying graphical.target won't delay start of display manager.
graphical.target already is ordered after display manager, delaying it
further won't change anything.

You need to delay actual service that starts graphical environment,
display-manager.service or similar; which one depends on your distribution.

At least if I understand your question correctly.
Post by Boyce, Kevin P [US] (AS)
Any help would be appreciated. I've thought of creating a new custom target and putting my service in it. Is there a way to force another target not to start until another target is completely finished?
Just wondering why this sort of operation is so hard.
Thanks,
Kevin
_______________________________________________
systemd-devel mailing list
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Lennart Poettering
2018-12-11 09:47:13 UTC
Permalink
Post by Boyce, Kevin P [US] (AS)
I seem to be struggling with what should be a very basic operation.
I've seen similar questions posted to the list here and none of them
are really adequate.
I'm trying to prompt the user to ask a question as the system is
coming up (so the system can configure it's network and other things
based on a hostname the user enters).
See how systemd-firstboot.service does this, for inspiration.

Lennart

--
Lennart Poettering, Red Hat

Loading...