iscsi: only systemctl try-restart iscsid, if systemd is used

master
Harald Hoyer 2015-11-13 13:16:10 +01:00
parent 98e9db2755
commit ed92ecaa3c
2 changed files with 25 additions and 6 deletions

View File

@ -115,9 +115,12 @@ handle_netroot()
rm -f /etc/iscsi/initiatorname.iscsi
mkdir -p /etc/iscsi
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
systemctl restart iscsid
sleep 1
> /tmp/iscsi_set_initiator
if [ -n "$DRACUT_SYSTEMD" ]; then
systemctl try-restart iscsid
# FIXME: iscsid is not yet ready, when the service is :-/
sleep 1
fi
fi

if [ -z "$iscsi_initiator" ]; then
@ -133,10 +136,12 @@ handle_netroot()
rm -f /etc/iscsi/initiatorname.iscsi
mkdir -p /etc/iscsi
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
systemctl restart iscsid
> /tmp/iscsi_set_initiator
# FIXME: iscsid is not yet ready, when the service is :-/
sleep 1
if [ -n "$DRACUT_SYSTEMD" ]; then
systemctl try-restart iscsid
# FIXME: iscsid is not yet ready, when the service is :-/
sleep 1
fi
fi


@ -157,6 +162,11 @@ handle_netroot()
if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then
mkdir -p /etc/iscsi
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
if [ -n "$DRACUT_SYSTEMD" ]; then
systemctl try-restart iscsid
# FIXME: iscsid is not yet ready, when the service is :-/
sleep 1
fi
fi
# FIXME $iscsi_protocol??


View File

@ -108,6 +108,11 @@ if arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) && [ -n "$arg" ] && ! [
if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then
mkdir -p /etc/iscsi
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
if [ -n "$DRACUT_SYSTEMD" ]; then
systemctl try-restart iscsid
# FIXME: iscsid is not yet ready, when the service is :-/
sleep 1
fi
fi
fi

@ -120,7 +125,11 @@ if [ -z $iscsi_initiator ] && [ -f /sys/firmware/ibft/initiator/initiator-name ]
mkdir -p /etc/iscsi
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
> /tmp/iscsi_set_initiator
systemctl try-restart iscsid && sleep 1
if [ -n "$DRACUT_SYSTEMD" ]; then
systemctl try-restart iscsid
# FIXME: iscsid is not yet ready, when the service is :-/
sleep 1
fi
fi
fi