Create a gist now

Instantly share code, notes, and snippets.

--- tgt-admin.orig 2010-02-02 20:56:19.000000000 +0900
+++ tgt-admin 2010-07-01 16:22:58.293046426 +0900
@@ -1166,7 +1166,7 @@
# Check if userspace uses this device
my $lsof_check = check_exe("lsof");
if ($lsof_check ne 1) {
- system("lsof $backing_store &>/dev/null");
+ system("lsof $backing_store >/dev/null 2>&1");
my $exit_value = $? >> 8;
if ($exit_value eq 0) {
execute("# Device $backing_store is used (already tgtd target?).");
#TGTD_ENABLE=no
TGTD_ENABLE=yes
# tgtd - Linux SCSI target framework Daemon
#
# Linux SCSI target framework (tgt) aims to simplify various SCSI
# target driver (iSCSI, Fibre Channel, SRP, etc) creation and maintenance.
description "scsi target framework daemon"
start on started rc-sysinit
stop on runlevel [!2345]
expect fork
respawn
pre-start script
. /etc/default/tgtd
[ "${TGTD_ENABLE}" = "yes" ] || { stop; exit 0; }
end script
post-start script
tgt-admin --offline ALL
tgt-admin --execute
tgt-admin --ready ALL
end script
pre-stop script
tgt-admin --delete ALL
end script
exec tgtd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment