[Home]

Summary:ASTERISK-02051: [patch] RedHat asterisk init script replacement
Reporter:damin (damin)Labels:
Date Opened:2004-07-17 23:25:11Date Closed:2004-09-25 02:26:23
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk
Description:Please evaluate the following script as a replacement to the existing redhat init script. This script is consistent with the behavior of the Debian script in bug 2008, and has been modified to detect and use safe_asterisk, or fall back to standard asterisk if not available.
Comments:By: Mark Spencer (markster) 2004-07-18 09:03:23

This one lacks the "reload" functionality of the current one

By: damin (damin) 2004-07-18 10:16:12

Per your comment, I have added "reload" support. Another difference that I noticed was that your scripts load and unload the ixj module, which I haven't added to the code as it is not a core part of asterisk. Please see the attached "asterisk-rev-1" script.

By: Mark Spencer (markster) 2004-07-18 15:13:36

Uhm, reload would be "asterisk -rx reload" right?

By: damin (damin) 2004-07-18 18:18:17

Hahaha.. yes they would and that is exactly what BRC and I said on IRC, but when we read your bug note, we assumed that you wanted us to duplicate the reload functionality that is in the CVS version. We took it literally. We'll rework the init scripts to do "reload" the "right" way, and we'll also add some logic to allow users to set "user" and "group" variables in the init script and thus start the system setuid. I'll grab current CVS and whip up a couple of changes here later tonight.

By: damin (damin) 2004-07-18 21:44:34

Alright.. updated a new revision of the init script that does the following:

1. Corrects the "reload" behaviour so that it issues an -rx 'reload'
2. Adds optional variabls AST_USER and AST_GROUP to accomodate the new -U and -G command line switches. Simply uncomment the variables and set them to the appropriate values.

HOWEVER: safe_asterisk does not actually take command line arguement and pass them along to asterisk. It uses a variable ASTARGS that is set within the script. I'll be updating safe_asterisk tonight to correct this and maintain backward compatibility. Now can we commit this to CVS? ;)

By: damin (damin) 2004-07-18 21:52:11

I made one simple typo fix and have uploaded a final script for review. As a result, I have also removed all the previous scripts, per BKW's suggestion to keep things clean. No need to keep versioning info in the bug tracker.

By: Mark Spencer (markster) 2004-07-18 22:03:24

Okies, it's merged!  Thanks for the contribution and especially for taking the time for going back and fixing it up!