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

Make sure to check/bootstrap directories first #479

Merged
merged 3 commits into from
Jan 13, 2022

Conversation

JRGTH
Copy link
Collaborator

@JRGTH JRGTH commented Jan 3, 2022

This hotfix will check/bootstrap directories first wen bootstrapping a Linux release, since it may happens that someone may install Bastille to initially play with Linux jails before bootstrapping a FreeBSD release first, leading to directories not found errors and creating legacy directories under ZFS setups.

Copy link
Collaborator Author

@JRGTH JRGTH left a comment

Choose a reason for hiding this comment

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

This will override the case options by the user defined option(s) automatically.
Just add bastille_export_options="--optionA --optionB" to bastille.conf.
Or simply export bastille_export_options="--optionA --optionB" environment variable.

To restore the standard case options, empty bastille_export_options="" in bastille.conf,
Or unset bastille_export_options environment variable.

Reference #443

Example on the behavior:

# bastille export test
Error: Stream can not be written to a terminal.
You must redirect standard output.

Error: An export option is required, see 'bastille export, otherwise the user must redirect to standard output.
# bastille export test > /tmp/test_backup
# bastille export test | gzip > /tmp/test_img.gz
# export bastille_export_options="--gz"
# bastille export test
Default export option: '--gz'
Exporting 'test' to a compressed .gz image...
Creating temporary ZFS snapshot for export...
Sending ZFS data stream...
 85.9%
Exported '/mnt/storage/bastille/backups/test_2022-01-04-164543.gz' successfully.
# export bastille_export_options="--gz --verbose"
# bastille export test
Default export option: '--gz --verbose'
Exporting 'test' to a compressed .gz image...
Creating temporary ZFS snapshot for export...
Sending ZFS data stream...
full send of storage/bastille/jails/test@bastille_test_2022-01-04-164553 estimated size is 50.1K
full send of storage/bastille/jails/test/root@bastille_test_2022-01-04-164553 estimated size is 7.00M
total estimated size is 7.04M
full send of storage/bastille/jails/test@bastille_test_2022-01-04-164553 estimated size is 50.1K
TIME        SENT   SNAPSHOT
full send of storage/bastille/jails/test/root@bastille_test_2022-01-04-164553 estimated size is 7.00M
TIME        SENT   SNAPSHOT
 85.9%
Exported '/mnt/storage/bastille/backups/test_2022-01-04-164553.gz' successfully.
# 
# unset bastille_export_options
# bastille export test
Error: Stream can not be written to a terminal.
You must redirect standard output.

Error: An export option is required, see 'bastille export, otherwise the user must redirect to standard output.

Notes:
When setting this config/environment variable, this should be fully specified with --xyz

Example:
export bastille_export_options="--gz --verbose" etc.

@cedwards
Copy link
Contributor

@JRGTH can you please create topic branches and separate the export code from the bootstrap patch? I can help you in Discord if you need.

@cedwards cedwards merged commit 548ab2e into BastilleBSD:master Jan 13, 2022
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.

None yet

2 participants