Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS-8264 Pool-bootable SmartOS (and Triton) cannot handle sdc-factoryreset #1110

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

danmcd
Copy link
Contributor

@danmcd danmcd commented Sep 19, 2024

OS-8578 Add "-s" option to sdc-factoryreset to poweroff CN instead of reboot

…eset

OS-8578 Add "-s" option to sdc-factoryreset to poweroff CN instead of reboot
@danmcd danmcd requested a review from a team September 19, 2024 18:36
@danmcd
Copy link
Contributor Author

danmcd commented Sep 19, 2024

NOTE: Needs testing, but conceptually this is good. Will update ticket(s) with test results.

Copy link

@tsoome tsoome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do like this:

shutdown=""

in case statement
s) shutdown=yes;;

and then

if [[ $shutdown ]]; then
poweroff
else
reboot
fi

Might be just a bit easier to read (less chars to process;)

@danmcd
Copy link
Contributor Author

danmcd commented Sep 19, 2024

You can do like this:

shutdown=""

in case statement s) shutdown=yes;;

and then

if [[ $shutdown ]]; then poweroff else reboot fi

Might be just a bit easier to read (less chars to process;)

Even better might be to just set a variable to the desired last-command!

@nheimlich
Copy link

nheimlich commented Sep 19, 2024

This may need to account for a shutdown rather than a reboot

printf "\n\nRebooting in 5 seconds ... "

also.. usage nit

printf "\nUsage: $myname [-h | --help]\n\n"

printf "\n\n$final_command in 5 seconds ... "

Comment on lines +37 to +45
function wipe_bootpools()
{
# disable booting on all pools -- XXX KEBE ASKS, make this optional?
for pool in $(piadm bootable | grep -v non-bootable | awk '{print $1}')
do
piadm bootable -d $pool
done
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very undecided as to whether I think this is ok here or if it should really be done in fs-joyent along with the rest of the pool resets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too, given work-Slack conversations (sorry folks in the open-source audience).

This is why 8264 was not examined a lot since its filing... we may want to split out 8578, and maybe have "wipe bootable now" in sdc-factoryreset as its own non-default option as part of 8578, and fix 8264 in fs-joyent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants