Fix Zigbee systemd start limit section and release stage 1.0.1

This commit is contained in:
Andrei Smaliak 2026-10-07 16:53:01 +02:00
parent 5af97d2c5a
commit f3b2f7e40b
5 changed files with 19 additions and 9 deletions

View File

@ -0,0 +1,6 @@
# Zigbee2MQTT stage 1.0.1
- Moved `StartLimitIntervalSec=0` from `[Service]` to `[Unit]` in the shared Zigbee2MQTT unit generator. systemd now honors the setting without an unknown-key warning; the existing wrapper remains responsible for retry backoff.
- Zigbee2MQTT application version and device configuration are unchanged. The stage version is raised so installed Edges can receive the correction through Console.
Validation: shell syntax check, systemd unit validation with local executable/user substitutions, and stage release catalog tests.

View File

@ -156,7 +156,7 @@ class StageVersionsTest(unittest.TestCase):
self.assertEqual('queued', job['state']) self.assertEqual('queued', job['state'])
def test_worker_installs_only_confirmed_stage_and_records_failure(self): def test_worker_installs_only_confirmed_stage_and_records_failure(self):
versions.delivery.write_json(versions.STATE / 'job.json', {'stage':'stage_z2m', 'commit':COMMIT, 'version':'1.0.0', 'unit':'test-job'}) versions.delivery.write_json(versions.STATE / 'job.json', {'stage':'stage_z2m', 'commit':COMMIT, 'version':self.catalog['stages']['stage_z2m']['version'], 'unit':'test-job'})
checkout = Path(versions.read_json(versions.CONFIG)['checkout']) checkout = Path(versions.read_json(versions.CONFIG)['checkout'])
checkout.mkdir() checkout.mkdir()
(checkout / 'stage-releases.json').write_text(json.dumps(self.catalog)) (checkout / 'stage-releases.json').write_text(json.dumps(self.catalog))
@ -181,7 +181,7 @@ class StageVersionsTest(unittest.TestCase):
self.assertFalse((versions.STATE / 'stage_ui.json').exists()) self.assertFalse((versions.STATE / 'stage_ui.json').exists())
def test_success_requires_receipt_from_this_job(self): def test_success_requires_receipt_from_this_job(self):
job = {'stage':'stage_z2m', 'commit':COMMIT, 'version':'1.0.0', 'unit':'unique-job'} job = {'stage':'stage_z2m', 'commit':COMMIT, 'version':self.catalog['stages']['stage_z2m']['version'], 'unit':'unique-job'}
checkout = Path(versions.read_json(versions.CONFIG)['checkout']) checkout = Path(versions.read_json(versions.CONFIG)['checkout'])
checkout.mkdir() checkout.mkdir()
(checkout / 'stage-releases.json').write_text(json.dumps(self.catalog)) (checkout / 'stage-releases.json').write_text(json.dumps(self.catalog))
@ -190,7 +190,7 @@ class StageVersionsTest(unittest.TestCase):
def finish(*args, **kwargs): def finish(*args, **kwargs):
self.assertEqual('unique-job', kwargs['env']['IOMATEX_INSTALL_JOB_ID']) self.assertEqual('unique-job', kwargs['env']['IOMATEX_INSTALL_JOB_ID'])
versions.delivery.write_json(versions.STATE / 'stage_z2m.json', { versions.delivery.write_json(versions.STATE / 'stage_z2m.json', {
'commit':COMMIT, 'version':'1.0.0', 'job_id':job_id, 'commit':COMMIT, 'version':job['version'], 'job_id':job_id,
}) })
with mock.patch.object(versions.delivery, 'bootstrap'), mock.patch.object(versions.subprocess, 'run', side_effect=finish): with mock.patch.object(versions.delivery, 'bootstrap'), mock.patch.object(versions.subprocess, 'run', side_effect=finish):
if expected == 'failed': if expected == 'failed':
@ -222,14 +222,17 @@ class StageVersionsTest(unittest.TestCase):
for stage, release in self.catalog['stages'].items(): for stage, release in self.catalog['stages'].items():
(root / stage).mkdir(parents=True) (root / stage).mkdir(parents=True)
(root / stage / 'version.json').write_text(json.dumps(release)) (root / stage / 'version.json').write_text(json.dumps(release))
bump_stage_version.bump(root, 'stage_z2m', '1.0.1') current = self.catalog['stages']['stage_z2m']['version']
major, minor, patch = map(int, current.split('.'))
next_version = f'{major}.{minor}.{patch + 1}'
bump_stage_version.bump(root, 'stage_z2m', next_version)
catalog = versions.validate_manifest(json.loads((root / 'stage-releases.json').read_text())) catalog = versions.validate_manifest(json.loads((root / 'stage-releases.json').read_text()))
self.assertEqual({'version':'1.0.1'},catalog['stages']['stage_z2m']) self.assertEqual({'version':next_version},catalog['stages']['stage_z2m'])
raw = json.loads((root / 'stage-releases.json').read_text()) raw = json.loads((root / 'stage-releases.json').read_text())
self.assertNotIn('stage_ip_stream', raw['stages']) self.assertNotIn('stage_ip_stream', raw['stages'])
self.assertIn('stage_ip_stream', raw['optional_stages']) self.assertIn('stage_ip_stream', raw['optional_stages'])
self.assertEqual(catalog['stages']['stage_z2m'],json.loads((root / 'stage_z2m/version.json').read_text())) self.assertEqual(catalog['stages']['stage_z2m'],json.loads((root / 'stage_z2m/version.json').read_text()))
with self.assertRaises(ValueError): bump_stage_version.bump(root, 'stage_z2m', '1.0.0') with self.assertRaises(ValueError): bump_stage_version.bump(root, 'stage_z2m', current)
def test_missing_catalog_and_denied_credentials_have_specific_messages(self): def test_missing_catalog_and_denied_credentials_have_specific_messages(self):
from urllib.error import HTTPError from urllib.error import HTTPError

View File

@ -11,7 +11,7 @@
"version": "1.0.2" "version": "1.0.2"
}, },
"stage_z2m": { "stage_z2m": {
"version": "1.0.0" "version": "1.0.1"
}, },
"stage_ui": { "stage_ui": {
"version": "3.1.20" "version": "3.1.20"

View File

@ -1214,6 +1214,8 @@ install_systemd_units() {
Description=Zigbee2MQTT (local MQTT only) with dongle-aware wrapper Description=Zigbee2MQTT (local MQTT only) with dongle-aware wrapper
After=network-online.target mosquitto.service After=network-online.target mosquitto.service
Wants=network-online.target mosquitto.service Wants=network-online.target mosquitto.service
# Disable systemd start throttling; the wrapper owns retry backoff.
StartLimitIntervalSec=0
[Service] [Service]
Type=simple Type=simple
@ -1225,7 +1227,6 @@ Environment=PATH=/usr/bin:/bin
ExecStart=/usr/local/sbin/iomatex-z2m-wrapper.sh ExecStart=/usr/local/sbin/iomatex-z2m-wrapper.sh
Restart=on-failure Restart=on-failure
RestartSec=30 RestartSec=30
StartLimitIntervalSec=0
LimitNOFILE=65536 LimitNOFILE=65536
[Install] [Install]

View File

@ -1,3 +1,3 @@
{ {
"version": "1.0.0" "version": "1.0.1"
} }