Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 911680 - sys-block/tgt new init.d script
Summary: sys-block/tgt new init.d script
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-08-03 17:51 UTC by Forza
Modified: 2023-08-15 18:53 UTC (History)
2 users (show)

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


Attachments
Patch for init.d/tgtd (tgtd.patch,6.46 KB, patch)
2023-08-03 17:51 UTC, Forza
Details | Diff
init.d/tgtd script (tgtd.initd,3.68 KB, text/plain)
2023-08-03 17:52 UTC, Forza
Details
conf.d/tgtd config file (tgtd.confd,202 bytes, text/plain)
2023-08-03 17:53 UTC, Forza
Details
New init.d/tgtd script (tgtd.initd,3.65 KB, text/plain)
2023-08-04 08:07 UTC, Forza
Details
Patch for init.d/tgtd (tgtd.patch,6.44 KB, patch)
2023-08-04 08:21 UTC, Forza
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Forza 2023-08-03 17:51:36 UTC
Created attachment 866966 [details, diff]
Patch for init.d/tgtd

I have rewritten the init script for tgt because the existing one has some problems. The existing script is based on an example from upstream, but it was written for SysV init, and not OpenRC. It uses, for example $RUNLEVEL instead of $RC_RUNLEVEL.


The new script is using OpenRC functions, and (hopefully) correctly handles reboots and configuration changes.

Thanks
Comment 1 Forza 2023-08-03 17:52:51 UTC
Created attachment 866967 [details]
init.d/tgtd script
Comment 2 Forza 2023-08-03 17:53:32 UTC
Created attachment 866968 [details]
conf.d/tgtd config file
Comment 3 Forza 2023-08-04 08:07:11 UTC
Created attachment 867002 [details]
New init.d/tgtd script

Small update with shellcheck. Also remove some curly brackets that aren't needed.
Comment 4 Forza 2023-08-04 08:21:51 UTC
Created attachment 867003 [details, diff]
Patch for init.d/tgtd
Comment 5 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2023-08-04 15:47:50 UTC
I know it's asking more of you, but would you like to submit a pull request to https://github.com/gentoo/gentoo/  That would allow attributing the change to you.
Comment 7 Forza 2023-08-14 21:03:39 UTC
I made an updated PR at https://github.com/gentoo/gentoo/pull/32197
Comment 8 Larry the Git Cow gentoo-dev 2023-08-15 18:53:56 UTC
The bug has been closed via the following commit(s):

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

commit 3a5c6ac8c88119c492a4a4dadcfce9aceb44b9a5
Author:     Matthew Thode <prometheanfire@gentoo.org>
AuthorDate: 2023-08-15 18:53:02 +0000
Commit:     Matthew Thode <prometheanfire@gentoo.org>
CommitDate: 2023-08-15 18:53:02 +0000

    sys-block/tgt: make init scripts posix compliant
    
    Thanks to Forza-tng for the new scripts
    
    Closes: https://bugs.gentoo.org/911680
    Closes: https://bugs.gentoo.org/836690
    
    Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>

 sys-block/tgt/files/tgtd.confd-new |   7 ++
 sys-block/tgt/files/tgtd.initd-new | 136 +++++++++++++++++++++++++++++++++++++
 sys-block/tgt/tgt-1.0.87-r1.ebuild |  61 +++++++++++++++++
 3 files changed, 204 insertions(+)