Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=46619040a68b0a69231f0fb60d924a1e682dd8d2
commit 46619040a68b0a69231f0fb60d924a1e682dd8d2 Author: James Buren <[email protected]> Date: Fri Jul 27 00:52:14 2012 -0500 tgt-1.0.19-2-x86_64 * convert to systemd schema diff --git a/source/network-extra/tgt/FrugalBuild b/source/network-extra/tgt/FrugalBuild index 4df2d91..f3fc3fa 100644 --- a/source/network-extra/tgt/FrugalBuild +++ b/source/network-extra/tgt/FrugalBuild @@ -3,7 +3,7 @@ pkgname=tgt pkgver=1.0.19 -pkgrel=1 +pkgrel=2 pkgdesc="Linux SCSI target framework (software iSCSI target)" _F_sourceforge_dirname="stgt" Finclude sourceforge @@ -11,15 +11,22 @@ depends=('perl-config-general') groups=('network-extra') archs=('i686' 'x86_64') up2date="Flasttar http://stgt.sourceforge.net/releases/" -source=(http://stgt.sourceforge.net/releases/$pkgname-$pkgver.tar.gz rc.tgtd) +backup=(etc/tgt/targets.conf) +source=(http://stgt.sourceforge.net/releases/$pkgname-$pkgver.tar.gz rc.tgtd tgtd.service) sha1sums=('4bb5488c72b5367201b96a86702373e3c298a419' \ - 'e27da7dc1f6e2ebfb4e047410f79aefc631c15e8') + 'e27da7dc1f6e2ebfb4e047410f79aefc631c15e8' \ + '5ed8c40f14e2a39ba55c2292305e974fa8d9ce39') +_F_sysvinit_units=(tgtd) +_F_systemd_units=(tgtd=) +Finclude systemd build() { Fsed 'README.ibmvstgt ' '' doc/Makefile # that file is missing Fbuild Frcd2 tgtd + Ffile /lib/systemd/system/tgtd.service + Fgenscriptlet } # optimization OK diff --git a/source/network-extra/tgt/tgtd.service b/source/network-extra/tgt/tgtd.service new file mode 100644 index 0000000..4d41ebc --- /dev/null +++ b/source/network-extra/tgt/tgtd.service @@ -0,0 +1,29 @@ +[Unit] +Description=tgtd iSCSI target daemon +After=network.target + +[Service] +ExecStart=/usr/sbin/tgtd -f +# Put tgtd into "offline" state until all the targets are configured. +# We don't want initiators to (re)connect and fail the connection +# if it's not ready. +ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v offline +# Configure the targets. +ExecStartPost=/usr/sbin/tgt-admin -e -c /etc/tgt/targets.conf +# Put tgtd into "ready" state. +ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v ready + +# Update configuration for targets. Only targets which +# are not in use will be updated. +ExecReload=/usr/bin/tgt-admin --update ALL -c /etc/tgt/targets.conf + +# NOTE: Shutdown of the iscsi target may cause data corruption +# for initiators that are connected. +ExecStop=/usr/sbin/tgtadm --op update --mode sys --name State -v offline +# Remove all targets. It only removes targets which are not in use. +ExecStop=/usr/sbin/tgt-admin --update ALL -c /dev/null +# tgtd will exit if all targets were removed +ExecStop=/usr/sbin/tgtadm --op delete --mode system + +[Install] +WantedBy=multi-user.target _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
