Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 841431 - net-misc/frr-8.5.2 installs shell script that uses non-POSIX features
Summary: net-misc/frr-8.5.2 installs shell script that uses non-POSIX features
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alarig Le Lay
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 609070
  Show dependency tree
 
Reported: 2022-04-28 06:59 UTC by Agostino Sarubbo
Modified: 2023-07-24 07:49 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,756.05 KB, text/plain)
2022-04-28 06:59 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-04-28 06:59:47 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: net-misc/frr-8.2.2 installs shell script that uses non-POSIX features.
Discovered on: amd64 (internal ref: ci)
Comment 1 Agostino Sarubbo gentoo-dev 2022-04-28 06:59:50 UTC
Created attachment 775110 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2022-12-08 17:37:29 UTC
ci has reproduced this issue with version 8.4.1 - Updating summary.
Comment 3 Agostino Sarubbo gentoo-dev 2023-02-05 09:01:02 UTC
ci has reproduced this issue with version 8.4.2 - Updating summary.
Comment 4 Agostino Sarubbo gentoo-dev 2023-04-04 08:45:22 UTC
ci has reproduced this issue with version 8.5 - Updating summary.
Comment 5 Agostino Sarubbo gentoo-dev 2023-07-15 06:54:02 UTC
ci has reproduced this issue with version 8.5.2 - Updating summary.
Comment 6 Alarig Le Lay 2023-07-15 08:01:47 UTC
`ulimit -n` is POSIX compatible:

alarig@pikachu ~ % dash
%B%F{green}%n@%m%k %B%F{blue}%1~ %# %b%f%kunset PS1

export PS1='$ '
$ 
$ ulimit -n 42 
$ echo $?
0
Comment 7 Jaco Kroon 2023-07-16 06:15:11 UTC
I sorted similar for asterisk.

Simplest ended up being using prlimit:

155 prlimit --core=${dumpcore} --pid=$$
156 prlimit --nofile=${maxfd} --pid=$$

This change is simple enough.  Line 109 of current RC script just needs to be updated to prlimit --nofile=${MAX_FDS} --pid=$$ >/dev/null 2>/dev/null, and RDEPEND="sys-apps/util-linux".

This is all that's required to fix the bashisms issue.


... looking at this init script it seems fairly complex.

Do we know that restart actually restarts the daemons or does it truly as implied merely reload?

243   # Handle restarts.
244   if [ "$RC_CMD" = 'restart' ]; then
245     ebegin 'Reloading FRR configuration'
246   else
247     ebegin 'Starting FRR'
248   fi

And, does it perform graceful restarts where possible?  One of the reasons we don't like upgrading FRR is because as a rule this is a problem for us.  Not so much on the reflectors (of which there's always two), but on the router-firewalls where routing has to remain up as much as possible.

I also note that if _frr_start fails then it's possible that start() will still respond success which is probably a bad thing to do. If you don't mind giving me a few days before applying the above to take a problem look at this script please.
Comment 8 Alarig Le Lay 2023-07-17 20:06:15 UTC
Thanks a lot for the tip! I commited the fix, the bot should add the MR to this bug very quick.
Comment 9 Jaco Kroon 2023-07-18 10:18:25 UTC
(In reply to Alarig Le Lay from comment #8)
> Thanks a lot for the tip! I commited the fix, the bot should add the MR to
> this bug very quick.

Cool, let's get this one in then.  Glad I could help.

My week got filled with a bunch of work that came in yesterday morning so not going to get a lot of time this week for Gentoo related work and pjproject[webrtc] is top of my list.
Comment 10 Larry the Git Cow gentoo-dev 2023-07-24 07:49:13 UTC
The bug has been closed via the following commit(s):

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

commit dab354ffbad5069f6a4de1330fe2b33e7619525e
Author:     Alarig Le Lay <alarig@swordarmor.fr>
AuthorDate: 2023-07-17 19:49:29 +0000
Commit:     Jakov Smolić <jsmolic@gentoo.org>
CommitDate: 2023-07-24 07:48:44 +0000

    net-misc/frr: Switch the init from ulimit to prlimit
    
    Suggested-by: Jaco Kroon <jaco@uls.co.za>
    Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
    Closes: https://bugs.gentoo.org/841431
    Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>

 net-misc/frr/files/frr-openrc-v2                   | 301 +++++++++++++++++++++
 .../frr/{frr-8.5.2.ebuild => frr-8.5.2-r1.ebuild}  |   3 +-
 2 files changed, 303 insertions(+), 1 deletion(-)