diff --git a/sysconfig.tgt b/sysconfig.tgt new file mode 100644 index 0000000..fed6159 --- /dev/null +++ b/sysconfig.tgt @@ -0,0 +1,11 @@ +## Path: Network/File systems/iSCSI +## Description: tgt iSCSI server options +## Type: string +## Default: "" +## ServiceRestart: tgtd +# +# Options for tgtd +# set listen addr with --iscsi portal=192.0.2.1:3260 +# +TGTD_OPTS="" + diff --git a/tgt.changes b/tgt.changes index 8b591fd..3f37c3d 100644 --- a/tgt.changes +++ b/tgt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 10 07:03:47 UTC 2015 - bwiedemann@suse.com + +- Allow to add options via sysconfig (bnc#828214) +- Drop invalid ExecStopPre entry + ------------------------------------------------------------------- Fri Jun 26 06:14:44 UTC 2015 - bwiedemann@suse.com diff --git a/tgt.spec b/tgt.spec index 04a7856..ad559ff 100644 --- a/tgt.spec +++ b/tgt.spec @@ -35,6 +35,7 @@ Group: System/Daemons Source: %{name}-%{version}.tar.bz2 Source1: %{name}d.service Source3: %{name}.services +Source4: sysconfig.%{name} Patch1: %{name}-git-update Patch2: %{name}-fix-build Patch3: setup-tgt-conf-d.patch @@ -72,6 +73,7 @@ Authors: %{__make} DESTDIR=%{buildroot} docdir=%_docdir/%{name} install install -vD -m 644 %{S:1} %{buildroot}/%{_unitdir}/%{name}d.service install -vD %{S:3} %{buildroot}/etc/sysconfig/SuSEfirewall2.d/services/tgt +install -vD %{S:4} ${RPM_BUILD_ROOT}/var/adm/fillup-templates/sysconfig.%{name} ln -sf service %{buildroot}/usr/sbin/rc%{name} %pre @@ -94,6 +96,7 @@ ln -sf service %{buildroot}/usr/sbin/rc%{name} %dir /etc/tgt/conf.d %config %attr(0644,root,root) /etc/tgt/targets.conf %config %attr(0644,root,root) /etc/sysconfig/SuSEfirewall2.d/services/tgt +/var/adm/fillup-templates/sysconfig.tgt %{_unitdir}/%{name}d.service %doc README doc/README.iscsi doc/README.iser doc/README.lu_configuration %doc doc/README.mmc doc/README.passthrough doc/README.sbcjukebox doc/README.ssc diff --git a/tgtd.service b/tgtd.service index daa1c2a..81d1834 100644 --- a/tgtd.service +++ b/tgtd.service @@ -3,11 +3,12 @@ Description=tgt admin After=network.target [Service] +EnvironmentFile=-/etc/sysconfig/tgt Type=forking User=root -ExecStart=/usr/sbin/tgtd +ExecStart=/usr/sbin/tgtd $TGTD_OPTS ExecStartPost=/bin/bash -c "sleep 0.5 ; /usr/sbin/tgtadm --op update --mode sys --name State -v offline ; /usr/sbin/tgt-admin -e -c /etc/tgt/targets.conf ; /usr/sbin/tgtadm --op update --mode sys --name State -v ready" -ExecStopPre=/usr/sbin/tgt-admin --update ALL -c /dev/null +# only valid in .socket: ExecStopPre=/usr/sbin/tgt-admin --update ALL -c /dev/null ExecStop=-/usr/sbin/tgtadm --op delete --mode system