Project

General

Profile

Actions

Feature #3623

open

Allow each package to choose if it is restarted on interface events

Added by Phillip Davis over 10 years ago. Updated over 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Package System
Target version:
-
Start date:
04/23/2014
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:

Description

Example discussion here about LCD-Proc: https://forum.pfsense.org/index.php?topic=7920.msg413642#msg413642

Some packages have code/daemon/processes that ddoes stuff that does not depend on the real-time interface state. Running the package restart code for these every time there is an interface state change (or other "significant" system event) is unnecessary and just results in interruption to service and possible issues for those packages.
Provide a way for a package to indicate/decide if it needs to actually bother restarting.
Possible solution:
a) Leave the "start" and "stop" actions as is - calling /var/local/etc/rc.d/packagename.sh "stop" would always expect the package to cleanup and stop, and similarly calling "start" always expects the package to really start.
b) "restart" action - add an optional parameter 2 (P2) to indicate the restart reason/type. For now, the only "reason" I can think of is "interfacechange". If P2 is not given, then all packages should respond by doing a full stop and start, like they do now. (This allows a manual restart from the webGUI, for example, to be assured that the package will actually stop and start). If P2 is given then each package can choose how to respond, based on the value of P2.
c) Events that currently call each packagename.sh "restart" will now also pass the extra parameter to indicate what type of event it is.

For something like LCD-proc and similar, it can choose to do nothing if P2 is "interfacechange" (or if P2 is anything at all).

Actions

Also available in: Atom PDF