Place START_SCRIPT*/INIT_SCRIPTS into /tmp

With new systemd, /var/run/ is mounted with noexec.
pull/89/head
Vlastimil Holer 8 years ago
parent 80276830d6
commit f8e97dea1b
No known key found for this signature in database
GPG Key ID: EB549BADEFD07C53

@ -1,11 +1,11 @@
#!/bin/bash
MOUNT_DIR=${MOUNT_DIR:-/mnt}
TMP_DIR=$(mktemp -d "${RUNTIME_DIR:-/tmp}.XXXX")
TMP_DIR=$(mktemp -d "/tmp/one-context.XXXXXX")
TMP_FILE="${TMP_DIR}/one-start-script"
START_SCRIPT_AVAILABLE=no
mkdir -p $TMP_DIR
chmod 700 "${TMP_DIR}"
if [ -n "$START_SCRIPT_BASE64" ]; then
echo -en "$START_SCRIPT_BASE64" | openssl enc -d -base64 -A > $TMP_FILE
@ -18,8 +18,7 @@ fi
if [ "$START_SCRIPT_AVAILABLE" = "yes" ]; then
cd $MOUNT_DIR
chmod +x $TMP_FILE
$TMP_FILE
fi
rm -rf ${TMP_DIR}
rm -rf "${TMP_DIR}"

@ -1,7 +1,9 @@
#!/bin/bash
MOUNT_DIR=${MOUNT_DIR:-/mnt}
TMP_DIR=$(mktemp -d "${RUNTIME_DIR:-/tmp}.XXXX")
TMP_DIR=$(mktemp -d "/tmp/one-context.XXXXXX")
chmod 700 "${TMP_DIR}"
if [ -z "$INIT_SCRIPTS" ]; then
if [ -f "$MOUNT_DIR/init.sh" ]; then
@ -9,13 +11,12 @@ if [ -z "$INIT_SCRIPTS" ]; then
fi
fi
mkdir -p $TMP_DIR
cd $MOUNT_DIR
for f in $INIT_SCRIPTS; do
cp $f $TMP_DIR
cp "$f" "${TMP_DIR}/"
chmod +x $TMP_DIR/$f
$TMP_DIR/$f
done
rm -rf ${TMP_DIR}
rm -rf "${TMP_DIR}"

Loading…
Cancel
Save