fix: passive health check + hop=0 in stabilization pass

Active PINGs on pineapd's command socket collided with the stock daemon's
own socket writes ('[PineAp] Error writing'), making the daemon watchdog
SIGTERM pineapd every ~30s while hopping. Monitor now checks pidof only
(no socket writes) and the stabilization pass pins wlan1mon hop=0.
This commit is contained in:
2026-08-18 21:05:39 -05:00
parent 4c5b459f72
commit ce1f6a8442
2 changed files with 18 additions and 12 deletions
+6 -3
View File
@@ -26,10 +26,10 @@ class HealthCheckTest(unittest.TestCase):
def fake_run(args, timeout=20, input_data=None):
self.runs.append((list(args), timeout))
a = list(args)
if a[0] == '/usr/bin/hak5cmd' and a[1] == 'PING':
if a[0] == 'pidof' and a[1] == 'pineapd':
if self.ping_ok:
return (0, 'Sending PING...\nGot PONG response\n', '')
return (1, '', 'could not connect to pineap: connection refused')
return (0, '12345\n', '')
return (1, '', '')
if a[0] == 'logread':
return (0, 'SIGSEGV\n' * self.sigsegs if hasattr(self, 'sigsegs') else '', '')
if a[:2] == ['uci', 'set']:
@@ -56,6 +56,8 @@ class HealthCheckTest(unittest.TestCase):
result = server.health_check()
self.assertTrue(result['pineap_up'])
self.assertIsNone(result['last_action'])
self.assertEqual([r[0] for r in self.runs], [['pidof', 'pineapd']],
'health check must not write to the pineapd socket')
def test_down_with_growing_sigsegv_disables_pool(self):
self.ping_ok = False
@@ -73,6 +75,7 @@ class HealthCheckTest(unittest.TestCase):
self.uci_state['pineapd.wlan2mon.hop'] = '0'
self.uci_state['pineapd.wlan1mon.bands'] = '5'
self.uci_state['pineapd.wlan0mon.bands'] = '2'
self.uci_state['pineapd.wlan1mon.hop'] = '0'
result = server.health_check()
self.assertEqual(result['last_action'], 'pineapd restart')
self.assertIn(['/etc/init.d/pineapd', 'restart'], [r[0] for r in self.runs])