Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 929138 - app-containers/incus: bashisms in /etc/conf.d/incus
Summary: app-containers/incus: bashisms in /etc/conf.d/incus
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Joonas Niilola
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: nonbash
  Show dependency tree
 
Reported: 2024-04-11 14:17 UTC by Violet Purcell
Modified: 2024-07-12 19:28 UTC (History)
3 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 Violet Purcell 2024-04-11 14:17:30 UTC
There are two different bashisms in /etc/conf.d/incus:

/etc/conf.d/incus:
INCUS_OPTIONS+=" --group incus-admin"

Should be:

INCUS_OPTIONS="${INCUS_OPTIONS} --group incus-admin}"

Second, passing multiple ulimit options in one call as specified by rc_ulimit="-n 1048576 -l unlimited" isn't supported by dash, so I assume it's a bashism. I'm not sure if ulimit is actually standardized anywhere though.
Comment 1 kfm 2024-04-30 10:16:48 UTC
(In reply to Violet Purcell from comment #0)

> INCUS_OPTIONS="${INCUS_OPTIONS} --group incus-admin}"

Presumably this was a mere typo but it should be:

INCUS_OPTIONS="${INCUS_OPTIONS} --group incus-admin"

> Second, passing multiple ulimit options in one call as specified by
> rc_ulimit="-n 1048576 -l unlimited" isn't supported by dash, so I assume
> it's a bashism. I'm not sure if ulimit is actually standardized anywhere
> though.

The only standard option is -f.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ulimit.html

I would suggest calling prlimit(1) from the runscript instead. It is provided by util-linux.
Comment 2 Joonas Niilola gentoo-dev 2024-06-29 06:17:03 UTC
I'll try to remember this with 6.3 bump.
Comment 3 Joonas Niilola gentoo-dev 2024-06-29 06:18:15 UTC
Oh and checkbashisms doesn't flag the "INCUS_OPTIONS+=" part, but I wonder if it's limited to just checking the init file.
Comment 4 Larry the Git Cow gentoo-dev 2024-07-12 08:58:04 UTC
The bug has been closed via the following commit(s):

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

commit dd8a0d3ea99d4353ab2ac59e4dbb48dc6ca52662
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2024-07-12 08:48:40 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2024-07-12 08:58:01 +0000

    app-containers/incus: add 6.3
    
     - clear out bashishms from openrc service files,
     - switch to calling 'prlimit' from the openrc init file instead of relying on
       openrc's rc_ulimit.
    
    Closes: https://bugs.gentoo.org/929138
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 app-containers/incus/Manifest              |   2 +
 app-containers/incus/files/incus-6.0.confd |  27 ++++
 app-containers/incus/files/incus-6.0.initd |  63 +++++++++
 app-containers/incus/incus-6.3.ebuild      | 219 +++++++++++++++++++++++++++++
 4 files changed, 311 insertions(+)
Comment 5 Violet Purcell 2024-07-12 19:10:53 UTC
The prlimit call needs to be "prlimit -n=1048576 -l=unlimited --pid=$$" instead of "prlimit -n 1048576 -l unlimited --pid=$$"
Comment 6 Joonas Niilola gentoo-dev 2024-07-12 19:25:39 UTC
(In reply to Violet Purcell from comment #5)
> The prlimit call needs to be "prlimit -n=1048576 -l=unlimited --pid=$$"
> instead of "prlimit -n 1048576 -l unlimited --pid=$$"

Ah crap, I must've forgotten to update the FILESDIR file. I fixed it locally straight in /etc/init.d
Comment 7 Larry the Git Cow gentoo-dev 2024-07-12 19:28:03 UTC
The bug has been referenced in the following commit(s):

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

commit b05fe66cb10d75cc17f9998db5fc98eee0e9a049
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2024-07-12 19:27:12 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2024-07-12 19:28:01 +0000

    app-containers/incus: update the prlimit syntax in 6.3
    
    Bug: https://bugs.gentoo.org/929138
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 app-containers/incus/files/incus-6.0.initd                     | 2 +-
 app-containers/incus/{incus-6.3.ebuild => incus-6.3-r1.ebuild} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)