Both read and sleep (with openvt -w) are executed (read -p message gets displayed) but fail to pause the booting.

I tried many combinations of options in /etc/systemd/system/<service>:


A use case is loading the GUI only after service script stops running. I need to optionally mount sshfs (also multiple user and host name options) as /home before the GUI loads and "freezes" /home as local partition (default).

closed as unclear what you're asking by l0b0, garethTheRed, cuonglm, Archemar, dr01 Nov 8 '15 at 12:43

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What are you trying to achieve? I have never heard of a use case for pausing boot to wait for user input. – l0b0 Nov 7 '15 at 11:59
  • I'm afraid that doesn't clarify it. If the service needs some input, why wouldn't that either be statically in a file or requested as soon as the user interacts with the service? – l0b0 Nov 7 '15 at 12:46
  • I think practical, non technical-worded questions can be helpful to many visitors. While I understand why some may find them misleading and prefer to downvote them, we can give each other a better chance to learn by offering clarifying answers (see my answer below as an example). Such question-answer pairs can still be very informative. Many people may face the same practical challenge. – argle Nov 7 '15 at 14:50
  • @l0b0 Updated. Thank you for your explanations. And your patience was greatly appreciated. – argle Nov 12 '15 at 9:29

"Pausing the booting" does not exactly apply with systemd; systemd runs multiple services in parallel.

However, by adding "dependencies" to services, you can essentially specify at which point the "booting should pause" and wait for your service.

For the use case above, add to /etc/systemd/system/<service>:

Description=commands to run before GUI loads

This will force display-manager.service to wait for <service>. In my case, <service> involves user input (for those readers that didn't get the connection), effectively "pausing the booting".

There's also a comment below for other commenters that expressed skepticism:

There is a use-case for this kind of thing - unlocking encrypted partitions. Because of bugs in systemd (bugs.freedesktop.org/show_bug.cgi?id=88483) it's not possible to unlock an encrypted multi-device Btrfs array during boot using the out-of-box systemd mechanism. You need to create your own systemd service file and this answer had the missing bit I needed in my service file after hours of trying. Thanks argle.

  • Waiting for user input and waiting for another service to be running are very different things. Why do you consider this an answer to the original question? – l0b0 Nov 7 '15 at 17:01
  • I wanted both the waiting and the pausing. As I explained, I was getting the waiting but I wasn't getting the pausing, so read was rendered useless. – argle Nov 7 '15 at 19:01
  • @l0b0 Does my latest edit help? What other clarification do you think is needed before we can reopen it? – argle Nov 9 '15 at 12:21
  • Sorry, but no. As I already pointed out, without more information it's unclear why you would ever want to do this. Could you explain more concretely and in detail what you are trying to achieve? The original question is a technical description of something you should never need to do... – l0b0 Nov 9 '15 at 19:34
  • I need to optionally mount sshfs (also multiple user and host name options) as /home before the GUI loads and "freezes" /home as local partition (default). – argle Nov 10 '15 at 10:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.