Ubuntu – How to skip ‘Please remove the installation medium then press enter’

live-usblubuntushutdownUbuntu

I have a time-consuming program running in Lubuntu 18.04 Live. It will take around one day to finish. After the program finishes the computer shuts down.

But since I am running Lubuntu Live, the computer asks me to

Please remove the installation medium then press enter

after initiating the shutdown.
I will be traveling away before the program can finish and will not be back in a few weeks. I don't want the computer to be powered on all that time.

My question is: Is there a timeout after which the computer will eventually shut down, or is there any way to skip this prompt and completely shut down Lubuntu Live?

Best Answer

In situations, where a remotely accessed rescue system is already running and a reboot into the installed OS is required, the prompt can be disabled by editing the file /sbin/casper-stop.

E.g., at the end of /sbin/casper-stop:

    eject -p -m $device >/dev/null 2>&1

    [ "$prompt" ] || return 0

add an unconditional return 0:

    eject -p -m $device >/dev/null 2>&1

    [ "$prompt" ] || return 0

    return 0
Related Question