mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
interfaces: fix an issue with a batch killbyname()
For 23.7 killbyname() should be removed. PID files are here to stay.
This commit is contained in:
parent
4292bd3500
commit
a59f8666a2
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2022 Franco Fichtner <franco@opnsense.org>
|
||||
* Copyright (C) 2015-2023 Franco Fichtner <franco@opnsense.org>
|
||||
* Copyright (C) 2004-2008 Scott Ullrich <sullrich@gmail.com>
|
||||
* Copyright (C) 2008-2009 Ermal Luçi
|
||||
* Copyright (C) 2005 Espen Johansen
|
||||
@ -1310,7 +1310,9 @@ function interface_proxyarp_configure($interface = '')
|
||||
|
||||
/* kill any running choparp, on restart "all" */
|
||||
if (empty($interface)) {
|
||||
killbyname('choparp'); /* XXX only kills one */
|
||||
foreach (glob('/var/run/choparp_*.pid') as $pidfile) {
|
||||
killbypid($pidfile);
|
||||
}
|
||||
}
|
||||
|
||||
$paa = array();
|
||||
|
||||
@ -32,8 +32,10 @@
|
||||
|
||||
require_once 'IPv6.inc';
|
||||
|
||||
/* XXX only two callers left, better remove this unreliable function */
|
||||
function killbyname($procname, $sig = 'TERM', $waitforit = true)
|
||||
{
|
||||
/* pgrep -n only kills the newest matching process */
|
||||
_killbypid(shell_safe('/bin/pgrep -anx %s', $procname), $sig, $waitforit);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user