1

I'm trying to create an iso that runs a script and turns off the machine (based off of the instructions listed by Peter Pudlak here).

With a few tweaks, everything seems to work on a ubuntu 16.04 iso. However, when I power off the machine, I'm prompted to eject the cd on shutdown. The machine does not power off until I manually hit enter. I'm trying to automate this process and can't manually hit enter when prompted. Is there a way to either

  1. Force turning off the machine without hitting this prompt or
  2. Customizing the iso further so that it doesn't have this behavior?

This article explains how to do what I want, but the files that it lists in step 6 are not part of a ubuntu 16.04 desktop iso. Any pointers would be appreciated.

2 Answers 2

0

After obtaining the base system for the Ubuntu ISO, edit the file /etc/rc0.d/S89casper and make the following modifications:

# eject -p -m /cdrom >/dev/null 2>&1

# [ "$prompt" ] || return 0
## Add the following line: 
return 0

# XXX - i18n
# MSG="Please remove the disc and close the tray (if any) then press ENTER: "

# Modify 
/sbin/usplash_write "TIMEOUT 86400"

# To read 
/sbin/usplash_write "TIMEOUT 0"

See: https://askubuntu.com/a/87508/214875

1
  • Thanks for checking in. I don't think those files exist on the 16.04 ISO (speculating: because 16.04 changed over to using systemd?). The files that I see in /etc/rc0.d look totally different (e.g., K01alsa-utils, K01cups-browsed, etc.). Additionally, looking through the files that are on the 16.04 ISO, I couldn't find anything that looked similar to the snippet that you posted. Commented Jun 2, 2017 at 20:51
0

In the Ubuntu 16.04 Live CD, the script that ejects the CD and waits for the keypress seems to be /sbin/casper-stop.

It's probably better not to delete the script, but if you comment out the lines plymouth watch-keystroke > /dev/null and read x < /dev/console, they should prevent the system from waiting for the Enter key.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .