Feature: We should probably reboot at the end of our build process #39

Closed
opened 2017-12-01 12:12:44 -08:00 by luciusbono · 4 comments
luciusbono commented 2017-12-01 12:12:44 -08:00 (Migrated from github.com)

I'd suggest we force a reboot at the end of our build. softwareupdate may require a reboot, depending on what it installs, and I'd rather the reboot just be a consistent action.

I'd suggest we force a reboot at the end of our build. `softwareupdate` may require a reboot, depending on what it installs, and I'd rather the reboot just be a consistent action.
luciusbono commented 2017-12-08 17:43:29 -08:00 (Migrated from github.com)

Added this feature in #49.

However, terminal remains open when the system is logged into next, because macOS does this by default. We'll leave this open as we investigate ways to avoid this.

Added this feature in [#49](https://github.com/mozilla/dinobuildr/pull/49). However, terminal remains open when the system is logged into next, because macOS does this by default. We'll leave this open as we investigate ways to avoid this.
luciusbono commented 2017-12-19 18:05:38 -08:00 (Migrated from github.com)

Still sort of stalled on this, but I did come to a very silly realization: part of the problem is that we're rebooting BEFORE the python script really has a chance to finish and clean up. This is real dumb (on my part)!

So, what we'll likely need to do is move the restart step into the config.py script itself, and maybe make it optional with a variable one can set so that we could avoid reboots in situations where this isn't necessary.

Timing will be interesting, but worst comes to worst we can call the reboot with subprocess relatively easily.

Still sort of stalled on this, but I did come to a very silly realization: part of the problem is that we're rebooting BEFORE the python script really has a chance to finish and clean up. This is real dumb (on my part)! So, what we'll likely need to do is move the restart step into the `config.py` script itself, and maybe make it optional with a variable one can set so that we could avoid reboots in situations where this isn't necessary. Timing will be interesting, but worst comes to worst we can call the reboot with subprocess relatively easily.
luciusbono commented 2018-01-03 23:06:41 -08:00 (Migrated from github.com)

After muuuuuuuch testing, it appears that the most stable way of doing this is within the "helper" script that we'll use to call down config.py. Example:

#!/bin/bash

python -c "$(curl https://raw.githubusercontent.com/mozilla/dinobuildr/bug-rebootchange/config.py)"
echo "Rebooting!"
osascript <<EOF
tell app "System Events" 
    restart
end tell
EOF

This method seems to reliably perform a clean shutdown and restore the output of script in the Terminal.

After muuuuuuuch testing, it appears that the most stable way of doing this is within the "helper" script that we'll use to call down `config.py`. Example: ```bash #!/bin/bash python -c "$(curl https://raw.githubusercontent.com/mozilla/dinobuildr/bug-rebootchange/config.py)" echo "Rebooting!" osascript <<EOF tell app "System Events" restart end tell EOF ``` This method seems to reliably perform a clean shutdown and restore the output of script in the Terminal.
luciusbono commented 2018-01-04 15:01:07 -08:00 (Migrated from github.com)

Merged in #77!

Merged in #77!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jlin/dinobuildr#39
No description provided.