disable all signals before sudoing lxd group

This commit is contained in:
pvincent
2024-03-02 17:08:20 +04:00
parent f9f22ee92e
commit e317c106d3
2 changed files with 10 additions and 1 deletions
+7
View File
@@ -90,6 +90,13 @@ function disable_trace() {
trap - ERR trap - ERR
} }
function disable_all_signals {
trap - ERR
trap - HUP
trap - INT
trap - TERM
}
function prepare_nftables() { function prepare_nftables() {
local PREFIX="miaou:nftables" local PREFIX="miaou:nftables"
+3 -1
View File
@@ -30,7 +30,9 @@ function prepare_lxd {
realcommand="$MIAOU_BASEDIR/lib/install.sh" realcommand="$MIAOU_BASEDIR/lib/install.sh"
sg "$NEW_GROUP" -c "EMAIL=$valid_email $realcommand SESSION_RELOAD_REQUIRED $TARGET" sg "$NEW_GROUP" -c "EMAIL=$valid_email $realcommand SESSION_RELOAD_REQUIRED $TARGET"
# sg "$NEW_GROUP" bash
set +e
disable_all_signals
sudo su - "$(whoami)" sudo su - "$(whoami)"
kill -9 "$PPID" kill -9 "$PPID"
# no further processing because exec has been called! # no further processing because exec has been called!