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

V2 of stratis-fstab-setup to order setup before fsck #3437

Closed
wants to merge 1 commit into from

Conversation

jbaublitz
Copy link
Member

Related to #3436

@jbaublitz jbaublitz requested a review from bmr-cymru September 13, 2023 14:10
@jbaublitz jbaublitz self-assigned this Sep 13, 2023
Copy link
Member

@bmr-cymru bmr-cymru left a comment

Choose a reason for hiding this comment

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

I've tested v2 with some minor changes to fix errors I saw running the script. Overall I think the fstab syntax is much better with v2 and I think this is preferable to putting the pool UUID into the options string but I still hit boot failures with the updated stratis-fstab-setup.

I resolved these by adding a Before=local-fs-pre.target to the [email protected] unit.

fi


if [ "$1" != dev-stratis* ]; then
Copy link
Member

Choose a reason for hiding this comment

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

This expression isn't working for me in testing. I had to change it to:

if [[ "$1" != dev-stratis* ]]; then

exit 1
fi

PATH="$1"
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be something like DEVPATH to avoid overwriting PATH - otherwise we'll get command not found for the binaries the script runs (stratis-min and sleep).

exit 1
fi

POOL_NAME="${$SEGMENTS[2]}"
Copy link
Member

Choose a reason for hiding this comment

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

To evaluate index 2 of the array this wants to be:

POOL_NAME="${SEGMENTS[2]}"


IFS='-' read -ra SEGMENTS <<< "$PATH"

if [ "${#SEGMENTS[@]}" != 4 ]; then
Copy link
Member

Choose a reason for hiding this comment

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

This won't work if there are embedded '-' characters in the pool or filesystem name (e.g. p1/fs1-snap). Systemd escapes '-' as \x2d in unit names but by the time the argument is passed to the stratis-fstab-setup script the escaping has been expanded to the literal '-' character.

@jbaublitz
Copy link
Member Author

@bmr-cymru I'm considering closing this out and moving the Before=pre-local-fs.target into #3436. Are you okay with that?

@bmr-cymru
Copy link
Member

@jbaublitz yes that seems reasonable to me. I will re-test with a clean set up and the changes from #3436 today.

Generally I think the changes you proposed here are an improvement in terms of the fstab syntax if we could get the proper escaping and decoding implemented but we can re-visit that in the future - the change to Before=local-fs-pre.target seems to be the key change to getting the fsck ordered properly.

@jbaublitz
Copy link
Member Author

@bmr-cymru I agree that it'd be an improvement. See #3438 for hopefully a better version of the pool name syntax that doesn't require the path or filesystem name.

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.

2 participants