From 491ebaedd3bb8232585c42cc84fbdd2aa210dbf6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 1 Mar 2020 18:26:01 +0100 Subject: Correcting call of post hooks in container start program to make them actually work, thanks to Simon Spoehel . Signed-off-by: Daniel Baumann --- lib/container/start | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/container/start') diff --git a/lib/container/start b/lib/container/start index f89944d..5938193 100755 --- a/lib/container/start +++ b/lib/container/start @@ -482,6 +482,15 @@ case "${SYSTEMCTL}" in true) systemctl start ${PROGRAM}@${NAME}.service + # Post hooks + for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}" + do + if [ -x "${FILE}" ] + then + "${FILE}" + fi + done + exit 0 ;; esac @@ -498,14 +507,5 @@ case "${START}" in *) # Run ${SETARCH} systemd-nspawn --keep-unit ${BIND} ${BIND_RO} ${BOOT} ${CAPABILITY} ${DIRECTORY} ${DROP_CAPABILITY} ${MACHINE} ${NETWORK_VETH_EXTRA} ${LINK_JOURNAL} ${REGISTER} - - # Post hooks - for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}" - do - if [ -x "${FILE}" ] - then - "${FILE}" - fi - done ;; esac -- cgit v1.2.3