Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 432464 - net-misc/asterisk-10.7.0 doesn't start when /bin/sh -> dash
Summary: net-misc/asterisk-10.7.0 doesn't start when /bin/sh -> dash
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-23 16:21 UTC by Stefan Briesenick (RETIRED)
Modified: 2012-09-03 08:47 UTC (History)
2 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 Stefan Briesenick (RETIRED) gentoo-dev 2012-08-23 16:21:23 UTC
the init-script fails with (syslog):

asterisk_wrapper: /lib64/rc/sh/runscript.sh: 43: set: Illegal option -o pipefail

when

/bin/sh -> dash

Perhaps one can work around this somehow...


Reproducible: Always

Steps to Reproduce:
1. ln -snf dash /bin/sh
2. /etc/init.d/asterisk start

Actual Results:  
asterisk(-wrapper) doesn't start, logs failure to syslog

Expected Results:  
asterisk starts
Comment 1 Tony Vroon (RETIRED) gentoo-dev 2012-08-24 11:42:08 UTC
Sounds like the asterisk wrapper may need some minor changes. Jaco, whilst we don't purport to support dash right now, can you see if lesser shells like this can cope, or whether we should have /bin/bash instead of /bin/sh?
Comment 2 Stefan Briesenick (RETIRED) gentoo-dev 2012-08-31 12:23:39 UTC
dash is posix only and init-scripts *should* be also posix-only for compatibility reasons.

if you need bash-features, use #!/bin/bash in external shell-scripts. But everything within #!/sbin/runscript is executed as "/bin/sh" and *not* "/bin/bash". So take care within init-scripts not to use any bashisms.

thanks.

btw: you could also have /bin/sh -> busybox ;-)
Comment 3 Tony Vroon (RETIRED) gentoo-dev 2012-08-31 12:31:56 UTC
This is not about the init script but about the wrapper. It can demand /bin/bash as it is external.
Comment 4 Stefan Briesenick (RETIRED) gentoo-dev 2012-08-31 13:22:06 UTC
yeah, that would be the easiest fix. do so!
Comment 5 Stefan Briesenick (RETIRED) gentoo-dev 2012-08-31 13:31:01 UTC
hmmm, but this "wrapper-script" seems to be part of the init-script, and the error is also triggered from there...

see asterisk_run_loop()

so it's /bin/runscript, which is basically /bin/sh.
Comment 6 Jaco Kroon 2012-09-03 08:07:47 UTC
What happened with my comments re this?

            set -o pipefail
            ${NICE} /usr/sbin/asterisk ${OPTS} 2>&1 >/dev/null
            result=$?
            set +o pipefail

We can nuke the first and last lines there - which is what is causing the problem.

We used to have a 2>&1 | logger -t asterisk_wrapper there in which case we needed the pipefail to detect asterisk failures correctly.

Since it's going /dev/null now we can just remove the two set lines and we will pass the dash test.  Much easier than externalizing the loop.
Comment 7 Tony Vroon (RETIRED) gentoo-dev 2012-09-03 08:36:36 UTC
+*asterisk-1.8.15.1 (03 Sep 2012)
+
+  03 Sep 2012; Tony Vroon <chainsaw@gentoo.org> +files/1.8.0/asterisk.initd3,
+  +asterisk-1.8.15.1.ebuild:
+  Security upgrade on the 1.8 branch, addressing a privilege escalation in the
+  manager interface and a failure to apply IAX2 ACLs when using Asterisk
+  Realtime Architecture (ARA). Fixes by Jaco Kroon address bug #429492 and bug
+  #432464.
Comment 8 Tony Vroon (RETIRED) gentoo-dev 2012-09-03 08:47:55 UTC
+*asterisk-10.7.1 (03 Sep 2012)
+
+  03 Sep 2012; Tony Vroon <chainsaw@gentoo.org> -asterisk-1.8.14.1.ebuild,
+  -asterisk-1.8.15.0.ebuild, -asterisk-10.6.1.ebuild, -asterisk-10.7.0.ebuild,
+  +asterisk-10.7.1.ebuild:
+  Security upgrade on the 10 branch, addressing a privilege escalation in the
+  manager interface and a failure to apply IAX2 ACLs when using Asterisk
+  Realtime Architecture (ARA). Fixes by Jaco Kroon address bug #429492 and bug
+  #432464. Clean out all vulnerable non-stable ebuilds.