darrek n00b
Joined: 10 Mar 2005 Posts: 6 Location: Oregon
|
Posted: Mon Sep 03, 2018 3:00 pm Post subject: targetcli-fb init script missing? |
|
|
Is it me, or does targetcli-fb not have an init script (for Gentoo) to restore configuration after reboot?
I ended up writing my own initscript based off another distribution since I couldn't find one.
May not be pretty, but it works. Here it is if anyone else wants it
/etc/inid.d/targetcli-fb
Code: | #!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
description="ISCSI Target"
command="/usr/bin/targetcli"
pidfile="/var/lock/targetcli-fb"
depend() {
need net
after modules-load
}
start() {
ebegin "Restoring ISCSI Target Configuration"
if ${command} restoreconfig >/dev/null 2>&1 ; then
touch /var/lock/targetcli
else
eerror "Error restoring ISCSI Configuration"
return 1
fi
eend $?
}
stop() {
ebegin "Clearing ISCSI Target Configuration"
if ${command} clearconfig confirm=True >/dev/null 2>&1 ; then
rm -f /var/log/targetcli > /dev/null 2>&1
else
eerror "Error Clearing ISCSI configuration"
return 1
fi
eend $?
}
restart() {
ebegin "Reloading persisted ISCSI Target Configuration"
stop
start
eend $?
}
|
-Darrek |
|