Handle remctl results that are larger than a single pipe buffer
[invirt/packages/invirt-base.git] / scripts / invirt-reload
index fdfa8b6..7792f50 100755 (executable)
@@ -1,8 +1,17 @@
 #!/bin/bash
 
+if [ x"$INVIRT_RELOAD_NOTRIGGER" = x ] && \
+    [ "$DPKG_MAINTSCRIPT_PACKAGE" != '' ] && \
+    [ $# = 0 ] && \
+    dpkg-trigger --check-supported 2>/dev/null; then
+    if dpkg-trigger --no-await invirt-reload; then
+        echo "invirt-reload: deferring update (trigger activated)"
+        exit 0
+    fi
+fi
+
 for script in $(run-parts --test /etc/init.d); do
-    if [ "${script#/etc/init.d/sipb-xen-}" != "$script" \
-        -o "${script#/etc/init.d/invirt-}" != "$script" ]; then
-       "$script" reload
+    if [ "${script#/etc/init.d/invirt-}" != "$script" ]; then
+       invoke-rc.d "${script#/etc/init.d/}" force-reload
     fi
 done