Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
comparison sbin/fjail @ 229:243dba574ad3
More sanity checks when configuring jails
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 02 Sep 2022 09:25:50 +0200 |
| parents | 4493e364cabf |
| children | c4d835ccb4ae |
comparison
equal
deleted
inserted
replaced
| 228:4493e364cabf | 229:243dba574ad3 |
|---|---|
| 378 fi | 378 fi |
| 379 | 379 |
| 380 # Deactive the by default empty root password | 380 # Deactive the by default empty root password |
| 381 pw -R "${_mp}" usermod -w no -n root | 381 pw -R "${_mp}" usermod -w no -n root |
| 382 | 382 |
| 383 sysrc -R "${_mp}" sendmail_enable=NONE | 383 if [ -f "${_mp}/etc/defaults/rc.conf" ]; then |
| 384 sysrc -R "${_mp}" clear_tmp_enable=YES | 384 |
| 385 sysrc -R "${_mp}" clear_tmp_X=NO | 385 sysrc -R "${_mp}" sendmail_enable=NONE |
| 386 sysrc -R "${_mp}" syslogd_flags=-ss | 386 sysrc -R "${_mp}" clear_tmp_enable=YES |
| 387 sysrc -R "${_mp}" bsdstats_enable=NO # no automatic BSD stats when booting | 387 sysrc -R "${_mp}" clear_tmp_X=NO |
| 388 | 388 sysrc -R "${_mp}" syslogd_flags=-ss |
| 389 # Timezone to CET | 389 sysrc -R "${_mp}" bsdstats_enable=NO # no automatic BSD stats when booting |
| 390 if [ ! -f "${_mp}/etc/localtime" ]; then | |
| 391 echo "Setting timezone to Europe/Berlin" | |
| 392 ln -s ../usr/share/zoneinfo/Europe/Berlin "${_mp}/etc/localtime" | |
| 393 echo "Europe/Berlin" > "${_mp}/var/db/zoneinfo" | |
| 394 else | 390 else |
| 395 echo "WARNING: \"${_mp}/etc/localtime\" exists already -- not changed" | 391 echo "WARNING: No \"${_mp}/etc/defaults/rc.conf\": not configuring \"rc.conf\"" |
| 392 fi | |
| 393 | |
| 394 if [ -f "${_mp}/usr/share/zoneinfo/Europe/Berlin" ]; then | |
| 395 # Timezone to CET | |
| 396 if [ ! -f "${_mp}/etc/localtime" ]; then | |
| 397 echo "Setting timezone to Europe/Berlin" | |
| 398 ln -s ../usr/share/zoneinfo/Europe/Berlin "${_mp}/etc/localtime" | |
| 399 echo "Europe/Berlin" > "${_mp}/var/db/zoneinfo" | |
| 400 else | |
| 401 echo "WARNING: \"${_mp}/etc/localtime\" exists already -- not changed" | |
| 402 fi | |
| 403 else | |
| 404 echo "WARNING: No timezone data file found at \"${_mp}/usr/share/zoneinfo/Europe/Berlin\": skipping timezone setup" | |
| 396 fi | 405 fi |
| 397 | 406 |
| 398 # resolv.conf | 407 # resolv.conf |
| 399 if [ ! -f "${_mp}/etc/resolv.conf" ]; then | 408 if [ ! -f "${_mp}/etc/resolv.conf" ]; then |
| 400 echo "Copying the host's resolv.conf into the jail" | 409 echo "Copying the host's resolv.conf into the jail" |
| 414 echo "daily_status_zfs_zpool_list_enable=\"NO\"" >> "${_pcl}" | 423 echo "daily_status_zfs_zpool_list_enable=\"NO\"" >> "${_pcl}" |
| 415 echo "daily_status_disks_enable=\"NO\"" >> "${_pcl}" | 424 echo "daily_status_disks_enable=\"NO\"" >> "${_pcl}" |
| 416 echo "daily_status_uptime_enable=\"NO\"" >> "${_pcl}" | 425 echo "daily_status_uptime_enable=\"NO\"" >> "${_pcl}" |
| 417 | 426 |
| 418 echo "security_status_chkmounts_enable=\"NO\"" >> "${_pcl}" | 427 echo "security_status_chkmounts_enable=\"NO\"" >> "${_pcl}" |
| 419 | 428 |
| 420 else | 429 else |
| 421 echo "WARNING: \"${_pcl}\" exists already -- not changed" | 430 echo "WARNING: \"${_pcl}\" exists already -- not changed" |
| 422 fi | 431 fi |
| 423 | 432 |
| 424 command_hostid | 433 command_hostid |
