mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 21:37:15 +02:00
if restoreconfig fails we correctly unmount, but eend is then 0 if umount works, and we don't flag the failure unroll it so the exitcode is based on the command only
31 lines
548 B
Bash
Executable File
31 lines
548 B
Bash
Executable File
#!/sbin/openrc-run
|
|
|
|
description="Administration tool for managing RisingTide Systems storage targets"
|
|
command="/usr/bin/targetcli"
|
|
|
|
depend() {
|
|
need dbus net
|
|
after firewall
|
|
}
|
|
|
|
start() {
|
|
ebegin "Starting ${RC_SVCNAME}"
|
|
for mod in $MODULES; do
|
|
modprobe $mod
|
|
done
|
|
mount -t configfs none /sys/kernel/config
|
|
$command restoreconfig clear_existing=true
|
|
ret=$?
|
|
if [ $ret -ne 0 ]; then
|
|
umount /sys/kernel/config
|
|
fi
|
|
eend $ret
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping ${RC_SVCNAME}"
|
|
$command clearconfig confirm=true
|
|
umount /sys/kernel/config
|
|
eend $?
|
|
}
|