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

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu Jun 19 14:41:42 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, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/53/28953/1

diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
index 2a006c0..e1f0c48 100644
--- a/ovirt-node.spec.in
+++ b/ovirt-node.spec.in
@@ -432,6 +432,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 f5877bc..db66436 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=/etc/ovirt-node/hooks/on-boot
+
 # Drop to a shell
 emergency_shell() {
     plymouth --hide-splash
@@ -1003,6 +1005,17 @@
 from ovirt.node.utils import firewall
 firewall.process_plugins()
 EOP
+
+    if [[ -d "$HOOK_ON_BOOT_DIR" ]];
+    then
+        for script in "$HOOK_ON_BOOT_DIR"/*;
+        do
+            handler="$HOOK_ON_BOOT_DIR"/"$script"
+            echo "Running handler: $handler"
+            "$handler"
+        done
+    fi
+
     return 0
 }
 


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

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



More information about the node-patches mailing list