[node-patches] Change in ovirt-node[node-3.0]: Add a on-boot hook to run scripts on boot

fabiand at fedoraproject.org fabiand at fedoraproject.org
Mon Jun 23 15:07:54 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: Add a on-boot hook to run scripts on boot
......................................................................

Add a on-boot hook to run scripts on boot

We now provide a hookdir where scripts can be put into to run scripts on
boot.

Change-Id: I306c1f12da7ec3e2454a8504cd3c462364a291f3
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M ovirt-node.spec.in
M scripts/ovirt-init-functions.sh.in
2 files changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/77/29077/1

diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
index 2bcfe4d..42f9b74 100644
--- a/ovirt-node.spec.in
+++ b/ovirt-node.spec.in
@@ -404,6 +404,7 @@
 %{__install} -d -m0755 %{buildroot}%{_libexecdir}/ovirt-node/hooks/pre-upgrade
 %{__install} -d -m0755 %{buildroot}%{_libexecdir}/ovirt-node/hooks/post-upgrade
 %{__install} -d -m0755 %{buildroot}%{_libexecdir}/ovirt-node/hooks/rollback
+%{__install} -d -m0755 %{buildroot}%{_libexecdir}/ovirt-node/hooks/on-boot
 
 %if %{is_f16}
 # install libvirtd systemd service
diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index 96bae07..87b8bc7 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -37,6 +37,8 @@
 AUGTOOL_CONFIG=/var/tmp/augtool-config
 EARLY_DIR=/etc/ovirt-early.d
 
+HOOK_ON_BOOT_DIR=/usr/libexec/ovirt-node/hooks/on-boot
+
 # Drop to a shell
 emergency_shell() {
     plymouth --hide-splash
@@ -999,6 +1001,16 @@
 from ovirt.node.utils import firewall
 firewall.process_plugins()
 EOP
+
+    if [[ -d "$HOOK_ON_BOOT_DIR" ]];
+    then
+        for handler in "$HOOK_ON_BOOT_DIR"/*;
+        do
+            echo "Running handler: $handler"
+            "$handler"
+        done
+    fi
+
     return 0
 }
 


-- 
To view, visit http://gerrit.ovirt.org/29077
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I306c1f12da7ec3e2454a8504cd3c462364a291f3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: node-3.0
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list