Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 363267 - net-misc/asterisk - startup script doesn't honor config variables in conf.d/asterisk
Summary: net-misc/asterisk - startup script doesn't honor config variables in conf.d/a...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-12 09:21 UTC by Jaco Kroon
Modified: 2011-09-01 14:09 UTC (History)
1 user (show)

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


Attachments
asterisk-initd (asterisk,6.36 KB, text/plain)
2011-08-17 23:10 UTC, Jaco Kroon
Details
asterisk-confd (asterisk,2.15 KB, text/plain)
2011-08-17 23:10 UTC, Jaco Kroon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2011-04-12 09:21:37 UTC
There are two config options in /etc/conf.d/asterisk that the init script doesn't honor unless ASTERISK_WRAPPER_SCRIPT is set to yes.

These options in particular is ASTERISK_MAX_FD and ASTERISK_NICE.

The following lines (copied from the loop code) should either be moved into the start() function, or duplicated for the non-wrapper case.

        if [ -n "${ASTERISK_MAX_FD}" ]; then
                ulimit -n ${ASTERISK_MAX_FD}
                echo "   Max open filedescriptors  : ${ASTERISK_MAX_FD}"
        fi

        if [ -n "${ASTERISK_NICE}" ]; then
                echo "   Nice level                : ${ASTERISK_NICE}"
                NICE="nice -n ${ASTERISK_NICE} --"
        fi


Reproducible: Always
Comment 1 Jaco Kroon 2011-08-17 23:09:13 UTC
Tony,

As per discussion, I'm about to add a new init.d script that removes the non-wrapper loop.  Other enhancements includes improved startup output (it turns out the wrapper loop still outputted to the controlling tty after being backgrounded.

Automatically pass -g to asterisk if ASTERISK_CORE_SIZE is set.

Merge two variants of ASTERISK_NICE handling to use the nice command seeing that --niceness isn't exaclty a legal asterisk option as far as I can tell, however, the error checking there was better.

Filter out -F too (explicit background) as with the wrapper that is a very, very bad idea.

Will issue a warning if asterisk is started as root.

ASTERISK_RESTART_DELAY will control how long the loop waits before restarting asterisk.  Defaults to 5 seconds.

Use asterisk -rx "module reload" instead of asterisk -rx "reload" as the reload actually comes from a cli alias which a user might configure away.

Hope I didn't re-introduce bashisms into the script, although, there are a few places that I would have loved to use bash-specific constructs.
Comment 2 Jaco Kroon 2011-08-17 23:10:17 UTC
Created attachment 283701 [details]
asterisk-initd
Comment 3 Jaco Kroon 2011-08-17 23:10:49 UTC
Created attachment 283703 [details]
asterisk-confd
Comment 4 Tony Vroon (RETIRED) gentoo-dev 2011-09-01 14:09:45 UTC
+*asterisk-1.8.6.0 (01 Sep 2011)
+
+  01 Sep 2011; Tony Vroon <chainsaw@gentoo.org> +files/1.8.0/asterisk.confd,
+  +files/1.8.0/asterisk.initd, +asterisk-1.8.6.0.ebuild:
+  Version bump. New & improved init script by Jaco Kroon closes bug #363267.
+  EAPI 4 porting by Agostino "ago" Sarubbo closes bug #380359.