Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 340175

Summary: net-mail/courier-imap-4.8.0: convert init.d to POSIX shell
Product: Gentoo Linux Reporter: Alec Moskvin <alecm>
Component: [OLD] ServerAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED FIXED    
Severity: enhancement CC: 4glitch, alecm, bircoph, toralf
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=270662
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 609070    
Attachments: Patch to remove bashisms from the init-scripts

Description Alec Moskvin 2010-10-08 17:35:58 UTC
OpenRC is shell-agnostic, and so it should not be assumed that the shell executing init-scripts is bash - only POSIX constructions should be there.

Reproducible: Always
Comment 1 Alec Moskvin 2010-10-08 17:38:03 UTC
Created attachment 249962 [details, diff]
Patch to remove bashisms from the init-scripts
Comment 2 SpanKY gentoo-dev 2010-10-09 21:20:27 UTC
POSIX compliance is not a requirement.  it's up to the maintainer to include it.

please do not cc people yourself.  let the wranglers take care of it.
Comment 3 Alec Moskvin 2010-10-10 01:16:50 UTC
(In reply to comment #2)
> POSIX compliance is not a requirement.  it's up to the maintainer to include
> it.

I think it's a perfectly valid bug if OpenRC tries to run bash scripts with /bin/sh ("the POSIX shell").

If the init-scripts are assumed to be written in bash, then it should run them with bash. And if the scripts are supposed to POSIX-compliant, then they shouldn't contain bash-specific features.

So either way, it's either a bug in the init-scripts or in OpenRC. Am I wrong in my thinking?
Comment 4 Toralf Förster gentoo-dev 2013-09-12 19:57:45 UTC
*** Bug 484694 has been marked as a duplicate of this bug. ***
Comment 5 rraneiendiarendiraendiaend 2015-06-20 17:50:41 UTC
(In reply to SpanKY from comment #2)
> POSIX compliance is not a requirement.  it's up to the maintainer to include
> it.

Why isn't it a requirement? If I understood correctly the goal of the gentoo project is maximum customization. The fact that many shell scripts (ebuilds, init scripts, etc) rely on non-POSIX-shell functionality actually reduces choices.

For instance, I would not like to use bash as /bin/sh but currently I can't replace bash because many init scripts (e.g hostname or courier-imap) rely on a bunch of bashisms (which sucks a lot). Another thing I would like to do is replace coreutils with busybox (see bug 60805) but you can't do that either since many shell scripts used by gentoo also rely on gnuisms (which sucks as well).

So in my opinion POSIX compliance should be a requirement, why isn't it?
Comment 6 Pacho Ramos gentoo-dev 2016-08-09 08:54:13 UTC
*** Bug 270662 has been marked as a duplicate of this bug. ***
Comment 7 Andrew Savchenko gentoo-dev 2017-02-12 13:00:49 UTC
Alec, thanks, patch is applied in the tree.
Comment 8 Alec Moskvin 2017-02-12 15:34:20 UTC
That was fast, thanks! :P