mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-08 21:16:39 +09:00
bug #2128: datastore file scripts are not executed in context
init scripts execution is moved to an external one-context.d script. Now there is a new context variable (INIT_SCRIPTS) with the list of files to execute from context.
This commit is contained in:
1 parent
bc6978e13a
commit
97eae56e60
2 files changed
+20
-3
No files matched your search
@@ -60,9 +60,6 @@ if [ -e "$CDROM_DEVICE" ]; then
|
||||
|
||||
execute_scripts
|
||||
|
||||
if [ -f /mnt/init.sh ]; then
|
||||
/mnt/init.sh
|
||||
fi
|
||||
umount /mnt
|
||||
else
|
||||
execute_scripts
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
MOUNT_DIR=/mnt
|
||||
TMP_DIR=/tmp/one-context-tmp
|
||||
|
||||
if [ -z "$INIT_SCRIPTS" ]; then
|
||||
if [ -f "$MOUNT_DIR/init.sh" ]; then
|
||||
INIT_SCRIPTS=init.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p $TMP_DIR
|
||||
cd $MOUNT_DIR
|
||||
|
||||
for f in $INIT_SCRIPTS; do
|
||||
cp $f $TMP_DIR
|
||||
chmod +x $TMP_DIR/$f
|
||||
$TMP_DIR/$f
|
||||
done
|
||||
|
||||
Reference in new issue
Block a user