qjail で diff がエラー
By takagiwa on Thursday, November 26 2020, 18:29 - FreeBSD - Permalink
qjail で jail を作ろうとするとエラーになる。
OS は 12.2-RELEASE 。
# qjail create -4 <ip address> -n <network interface> <jail name> error: conflicting output format options. usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case] [--no-ignore-case] [--normal] [--strip-trailing-cr] [--tabsize] [-I pattern] [-L label] file1 file2 diff [-aBbdilpTtw] [-I pattern] [-L label] [--ignore-case] [--no-ignore-case] [--normal] [--strip-trailing-cr] [--tabsize] -C number file1 file2 diff [-aBbdiltw] [-I pattern] [--ignore-case] [--no-ignore-case] [--normal] [--strip-trailing-cr] [--tabsize] -D string file1 file2 diff [-aBbdilpTtw] [-I pattern] [-L label] [--ignore-case] [--no-ignore-case] [--normal] [--tabsize] [--strip-trailing-cr] -U number file1 file2 diff [-aBbdilNPprsTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case] [--no-ignore-case] [--normal] [--tabsize] [-I pattern] [-L label] [-S name] [-X file] [-x pattern] dir1 dir2 diff [-aBbditwW] [--expand-tabs] [--ignore-all-blanks] [--ignore-blank-lines] [--ignore-case] [--minimal] [--no-ignore-file-name-case] [--strip-trailing-cr] [--suppress-common-lines] [--tabsize] [--text] [--width] -y | --side-by-side file1 file2 Error invalid directories in flavor default.
/usr/local/bin/qjail がスクリプトだったので diff を探したら一箇所だけ出てきた。
# Check the flavor for directories it should NOT be playing with. # # Load directory names to be excluded from diff to std-out # and pipe to the diff -X option. # example_flavor="/usr/local/share/examples/qjail/default" flavor_path="${flavors_dir}/${flavor}" /bin/cat << EOF | etc home root EOF diff -ruq -X - "${example_flavor}" "${flavor_path}" [ $? -eq 0 ] || \ kill "Error invalid directories in flavor ${flavor}."
diff のオプションの u と q がぶつかっているみたい。でもどちらかにしても相変わらずエラーになる。
2020 Nov 27 追記
diff は、/usr/local/share/examples/qjail/default/etc/ に resolv.conf が無かったことに文句を言っていた。
# cp /usr/jails/flavors/default/etc/resolv.conf /usr/local/share/examples/qjail/default/etc/ # diff -r /usr/local/share/examples/qjail/default /usr/jails/flavors/default
で何も出ないことを確認したら、ひとまず qjail create は通るようになった。