Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915140 - sys-block/tgt-1.0.88 does not respect tgtd_opts
Summary: sys-block/tgt-1.0.88 does not respect tgtd_opts
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-03 20:55 UTC by ixuz
Modified: 2023-10-17 09:42 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ixuz 2023-10-03 20:55:41 UTC
I've upgraded from 1.0.86 to 1.0.88 and now tgtd_opts from /etc/conf.d/tgtd does get used anymore.

I patched the start script, now it works again:

--- /etc/init.d/tgtd	2023-10-03 22:50:30.818215479 +0200
+++ /etc/init.d/tgtd.patched	2023-10-03 22:49:20.541409635 +0200
@@ -9,7 +9,7 @@

 pidfile="/var/run/${RC_SVCNAME}.pid"
 command="/usr/sbin/tgtd"
-command_args_background="--pid-file ${pidfile}"
+command_args_background="--pid-file ${pidfile} ${tgtd_opts}"
 extra_commands="forcedstop"
 extra_started_commands="forcedreload reload"


When there is a better place, please let me know. Or better please fix, thank you! :-)
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-04 00:14:19 UTC
Please don't CC manually - a bunch of the people you CCed aren't even involved with tgt.

Thanks for the report.
Comment 2 Forza 2023-10-07 13:06:15 UTC
I think we can fix this like so:

# Default configuration fike
: "${tgtd_conf:=/etc/tgt/targets.conf}"
: "${tgtd_opts:=" "}"
pidfile="/var/run/${RC_SVCNAME}.pid"
command="/usr/sbin/tgtd"
command_args_background="--pid-file ${pidfile} ${tgtd_opts}"
extra_commands="forcedstop"
extra_started_commands="forcedreload reload"
Comment 3 Forza 2023-10-07 14:03:55 UTC
@ixuz, I'm curious what extra options you are using?
Comment 4 ixuz 2023-10-07 14:36:54 UTC
(In reply to Forza from comment #3)
> @ixuz, I'm curious what extra options you are using?

I need IP address/port binding with "--iscsi portal=".

I wonder where/when /etc/conf.d/tgtd is parsed for tgtd_opts ?

Your addition to my change works also, thank you.
Comment 5 Forza 2023-10-07 14:43:25 UTC
Thanks for your update. 

OpenRC always sources the /etc/conf.d/${RC_SVCNAME} file, so it is not required to include it manually.

If you create a service /etc/init.d/foo, the /etc/conf.d/foo will be sourced automatically.
Comment 6 ixuz 2023-10-07 15:01:18 UTC
That make sense. Thanks for clarification.

I guess you already have seen my comment under your pull request at the Github upstream repo!? Maybe you could do the pull request which the author/maintainer requested? Would appreciate it.
Comment 7 Forza 2023-10-07 22:10:21 UTC
Before doing a new PR on Github, is there anything else we ought to change? We can opt to use the upstream version of this init script, instead of keeping a Gentoo custom version.

In Alpine Linux we have two init scripts.
https://git.alpinelinux.org/aports/tree/testing/scsi-tgt?h=master
Comment 8 ixuz 2023-10-08 10:19:21 UTC
I don't know. For me it works as expected with this little change.

Didn't even know that there is a difference between upstreams OpenRC script and this one from Gentoo.
Comment 9 Forza 2023-10-12 11:25:48 UTC
(In reply to ixuz from comment #8)
> I don't know. For me it works as expected with this little change.
> 
> Didn't even know that there is a difference between upstreams OpenRC script
> and this one from Gentoo.

Have a look and see if you are OK with the change. 
https://github.com/fujita/tgt/pull/60
Comment 10 ixuz 2023-10-12 11:55:08 UTC
LGTM, thank you.
Comment 11 Forza 2023-10-16 04:58:29 UTC
The fix has been merged upstream.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-16 05:07:57 UTC
(In reply to Forza from comment #11)
> The fix has been merged upstream.

Make a PR to pull it in?
Comment 13 Forza 2023-10-17 06:44:46 UTC
(In reply to Sam James from comment #12)
> (In reply to Forza from comment #11)
> > The fix has been merged upstream.
> 
> Make a PR to pull it in?

https://github.com/gentoo/gentoo/pull/33368
Comment 14 Larry the Git Cow gentoo-dev 2023-10-17 09:18:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db5fe2a0dd4dd1f6bb1761110922b645451a4cf8

commit db5fe2a0dd4dd1f6bb1761110922b645451a4cf8
Author:     Forza <68693597+Forza-tng@users.noreply.github.com>
AuthorDate: 2023-10-17 06:40:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-17 09:17:56 +0000

    sys-block/tgt: Update tgtd.initd-new
    
    Add missing `${tgtd_opts}` which was missing in previous commit.
    
    Closes: https://bugs.gentoo.org/915140
    Signed-off-by: Forza <68693597+Forza-tng@users.noreply.github.com>
    Closes: https://github.com/gentoo/gentoo/pull/33368
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-block/tgt/files/tgtd.initd-new                           | 2 +-
 sys-block/tgt/{tgt-1.0.87-r1.ebuild => tgt-1.0.87-r2.ebuild} | 0
 sys-block/tgt/{tgt-1.0.88.ebuild => tgt-1.0.88-r1.ebuild}    | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-17 09:18:53 UTC
Forza, now that these are upstream, could we switch the ebuild (in the next release) to use the upstream versions and not use the ones from files/?
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-17 09:19:29 UTC
(In reply to ixuz from comment #8)
> I don't know. For me it works as expected with this little change.
> 
> Didn't even know that there is a difference between upstreams OpenRC script
> and this one from Gentoo.

Forza only added it upstream recently :)
Comment 17 Forza 2023-10-17 09:42:29 UTC
(In reply to Sam James from comment #15)
> Forza, now that these are upstream, could we switch the ebuild (in the next
> release) to use the upstream versions and not use the ones from files/?

I don't see why not. But maybe @prometheanfire should should decide this as I am not a Gentoo maintainer (yet :).