bastille
bastille copied to clipboard
[ENHANCEMENT] Validate -L parameter for release {focal,bionic}
Is your feature request related to a problem? Please describe.
Bastille create
won't validate if -L option is added when creating focal/bionic release:
bastille create focaljail focal 192.168.20.4
Valid: (192.168.20.4).
sed: etc/crontab: No such file or directory
[focaljail]:
focaljail: created
jail: focaljail: getpwnam: No such file or directory
jail: focaljail: /bin/sh /etc/rc: failed
focaljail: removed
[focaljail]: Not started. See 'bastille start focaljail'.
[focaljail]: Not started. See 'bastille start focaljail'.
[focaljail]:
focaljail: created
jail: focaljail: getpwnam: No such file or directory
jail: focaljail: /bin/sh /etc/rc: failed
focaljail: removed
Describe the solution you'd like Option A: autodetect Linux OS in create.sh (if release=[focal,bionic] than create_linux_jail) Option B: if release=[focal,bionic] and jail_type!=linux than err "Linux releases require -L option"
Hi hackacad, is this related to the options parsing or the create_linux_jail loop itself?
Be aware that bastille create will require -L|--linux option, otherwise it will be treated as a regular FreeBSD jail which is bastille's default.
So the user should explicitly tell if a Linux jail is wanted, I will make some extra validation to ensure this option should be parsed. Regards
Hey Jose, exactly. This is about handling the arguments correctly. Prevent using focal/bionic as the release when not using the -L option. (-L requires focal/bionic; !-L must not use focal/bionic)
It's not a bug, it's a simple feature to prevent creating a non-Linux jail with Linux bootstrap.
Agree, I will add the validation for the Linux jails to prevent the above issue.
This small changes in create command address the above issue: c90fea3
@JRGTH was this fix merged previously per your comment? If so, can I close this one as done??
upon investigation, this fix was merged to master 2 years ago. Closing as finished. @JRGTH thank you for fixing this.
CLOSED