<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I'm working on a systemd.service file which should eject your CD/DVD
    and stop to display a<br>
    message so the user can react and close his cd-tray.<br>
    <br>
    This was my first draft:<br>
    <br>
    <small>[Unit]<br>
      Description=LiveMedia Eject Service<br>
      <br>
      [Service]<br>
      Type=oneshot<br>
      RemainAfterExit=true<br>
      ExecStart=/bin/true<br>
      ExecStop=/etc/manjaro/ejectcd<br>
      <br>
      [Install]<br>
      WantedBy=multi-user.target</small><br>
    <br>
    Lennart gave me than some tips to make my script better:<br>
    <br>
    <small>Hmm, service are not really supposed to be interactive in the
      systemd
      world, but you can still make this work, <br>
      but should do that only for
      early boot and late shutdown services where you are sufficiently
      sure
      that nobody <br>
      else will interfere with your console IO. Simply use
      StandardInput=tty-force in the [Service] section which <br>
      should do the
      trick.</small><br>
    <br>
    Testing it a little more I came to this:<br>
    <br>
    <blockquote type="cite" style="color: #000000;">
      <pre wrap="">I added what you suggested like this:

[Unit]
Description=LiveMedia Eject Service

[Service]
StandardInput=tty-force
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/etc/manjaro/ejectcd

[Install]
WantedBy=multi-user.target

I can see the output now. I attached a screenshot of my virtualbox.
In my bash-script I added a "read" cmd so that script would wait for
user-interactivity.

Somehow systemd ends my service file so I never be able to react.
Also as you can see in my screenshot at least 15 services get
stopped after my service got killed.
Maybe I've to add it to another category and not to multi-user.target
</pre>
    </blockquote>
    <pre wrap=""><big>Lennart answerd me later:</big>

All operations are timed out in systemd by default. You can turn this
off by pasing TimeoutSec=0. 

However, I'd probably recommend you to define your service a bit
differently. Add this to [Unit]:

        DefaultDependencies=no
        After=shutdown.target
        Before=final.target

And just use ExecStart= to spawn your code, drop the ExecStop=.

And then pull that in from final.target.

In case you wonder: the charts at the end of this man page might
explain better where a service like that is positioned:

<a class="moz-txt-link-freetext" href="http://www.freedesktop.org/software/systemd/man/bootup.html">http://www.freedesktop.org/software/systemd/man/bootup.html</a>

</pre>
    Now my script seems to be more properly written.<br>
    I see that message only some seconds but still have no option<br>
    to interact or make my virtualbox machine stop and wait for me
    hitting the "Enter"-key.<br>
    <br>
    Does the community has a clue for me?<br>
    <br>
    kind regards<br>
    <br>
    Phil<br>
    <br>
    <br>
  </body>
</html>