# HG changeset patch # User Franz Glasner # Date 1661758801 -7200 # Node ID 39b736a91d0df4debdc6bd5e4bd2457152e3d864 # Parent e370985c08ad552b4176476e7c27f84a53b6a3ff Begin a "configure" command for jails diff -r e370985c08ad -r 39b736a91d0d sbin/fjail --- a/sbin/fjail Thu Aug 25 08:54:31 2022 +0200 +++ b/sbin/fjail Mon Aug 29 09:40:01 2022 +0200 @@ -64,6 +64,11 @@ Populate the jail directory in MOUNTPOINT with the base system in BASETXZ + configure MOUNPOINT + + Configure some basic parts of the system at MOUNTPOINT: + disable root password, syslog and other basic configuration settings + copy [OPTIONS] SOURCE-DATASET DEST-DATASET Copy a tree of ZFS datasets with "zfs send -R" and "zfs receive". @@ -319,6 +324,40 @@ # +# "configure" -- configure the mountpoint +# +# command_configure mountpoint +# +command_configure() { + # mountpoint + local _mp + + _mp="$1" + + if [ -z "${_mp}" ]; then + echo "ERROR: no mountpoint given" >&2 + return 2 + fi + if [ ! -d "${_mp}" ]; then + echo "ERROR: mountpoint \`${_mp}' does not exist" >&2 + return 1 + fi + + # Deactive the by default empty root password + pw -R "${_mp}" usermod -w no -n root + + sysrc -R "${_mp}" sendmail_enable=NONE + sysrc -R "${_mp}" clear_tmp_enable=YES + sysrc -R "${_mp}" clear_tmp_X=NO + sysrc -R "${_mp}" syslogd_flags=-ss + sysrc -R "${_mp}" bsdstats_enable=NO # no automatic BSD stats when booting + + # Timezone to CET + ln -s ../usr/share/zoneinfo/Europe/Berlin "${_mp}/etc/localtime" +} + + +# # "copy" -- ZFS copy of datasets # # command_copy source-dataset destination-dataset @@ -621,6 +660,9 @@ populate) command_populate "$@" ;; + configure) + comment_configure "$@" + ;; copy) command_copy "$@" ;;