[Asterisk-code-review] asterisk.c: Prevent duplicate Asterisk processes from starting. (asterisk[master])

N A asteriskteam at digium.com
Mon Dec 12 09:37:14 CST 2022


Attention is currently required from: Joshua Colp.

N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/19655 )

Change subject: asterisk.c: Prevent duplicate Asterisk processes from starting.
......................................................................


Patch Set 1:

(1 comment)

Patchset:

PS1: 
> Is this a common practice of other applications in the same realm of Asterisk?
I don't know about specific programs, but it's somewhat of a recommended way of doing this:

"...algorithm for determining the status and the pid(s) of the specified program. They shall read the pidfile specified or otherwise /var/run/basename.pid and use the pid(s) herein when determining whether a program is running. The method used to determine the status is implementation defined, but should allow for non-binary programs.

Compliant implementations may use other mechanisms besides those based on pidfiles, unless the -p pidfile option has been used. Compliant applications should not rely on such mechanisms and should always use a pidfile. When a program is stopped, it should delete its pidfile. Multiple pid(s) shall be separated by a single space in the pidfile and in the output of pidofproc... This runs the specified program as a daemon.

start_daemon shall check if the program is already running using the algorithm given above. If so, it shall not start another copy of the daemon"

https://refspecs.linuxfoundation.org/LSB_2.0.1/LSB-generic/LSB-generic/iniscrptfunc.html



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19655
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I38d8d75567524ffd6b1779aa24e7f2bd6951fbb3
Gerrit-Change-Number: 19655
Gerrit-PatchSet: 1
Gerrit-Owner: N A <asterisk at phreaknet.org>
Gerrit-Reviewer: Friendly Automation
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Mon, 12 Dec 2022 15:37:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221212/9ed0646f/attachment.html>


More information about the asterisk-code-review mailing list