comparison sbin/ftjail @ 432:d46315901037

Before doing a freebsd-update in a thin jail also check for opened additional log sockets. They hinder proper umounting of filesystems.
author Franz Glasner <fzglas.hg@dom66.de>
date Sat, 18 Nov 2023 08:37:14 +0100
parents 30956bb06421
children 91b275a3facf
comparison
equal deleted inserted replaced
431:7694275f2df1 432:d46315901037
986 local _root_dataset _root_mountpoint _root_type _root_options 986 local _root_dataset _root_mountpoint _root_type _root_options
987 local _clone_extra_props _canmount_prop 987 local _clone_extra_props _canmount_prop
988 local _line _opt 988 local _line _opt
989 local _root_readonly _root_origin 989 local _root_readonly _root_origin
990 local _u_tmpdir 990 local _u_tmpdir
991 local _add_log_sock
991 992
992 _opt_keep="no" 993 _opt_keep="no"
993 _opt_old_origin="" 994 _opt_old_origin=""
994 while getopts "ko:" _opt ; do 995 while getopts "ko:" _opt ; do
995 case ${_opt} in 996 case ${_opt} in
1032 else 1033 else
1033 echo "ERROR: Please stop the \`${_jailname}' jail" >&2 1034 echo "ERROR: Please stop the \`${_jailname}' jail" >&2
1034 return 1 1035 return 1
1035 fi 1036 fi
1036 fi 1037 fi
1038 #
1039 # Check whether additional log sockets are opened at their default
1040 # locations. Because they hinder proper unmounting of filesystems.
1041 #
1042 for _add_log_sock in /var/run/log /var/run/logpriv ; do
1043 if [ -S "${_directory}${_add_log_sock}" ]; then
1044 echo "ERROR: additional log socket is open at \`${_directory}${_add_log_sock}'" >&2
1045 return 1
1046 fi
1047 done
1048
1049
1037 _dir_mounts="$(_get_mounts_at_directory "${_directory}")" 1050 _dir_mounts="$(_get_mounts_at_directory "${_directory}")"
1038 1051
1039 # 1052 #
1040 # Check preconditions thoroughly! 1053 # Check preconditions thoroughly!
1041 # 1054 #