Repository navigation
pystemd 0.16.0: file descriptor store support, Unit.SetProperties, pystemd.utils.ns.join_namespaces, delegate= in pystemd.run, fixes for pystemd.run waits and pystemd.futures on systemd 259 / Python 3.14, crash and leak fixes in pystemd.dbuslib, py.typed and a PyInstaller hook.
Behaviour changes to check when upgrading:
DbusMessage.get_path(),get_interface(),get_member(),get_destination()andget_sender()returnNonefor a header field the message lacks (they used to crash the interpreter)DBus.match_signalno longer sets ametadataattribute on the callback- Using a closed
DBusraisesDBusError(it used to corrupt memory); sd-bus errors while building a message, and unbalanced(in signatures, raise instead of being ignored
Changes:
- Fix
pystemd.run(wait=True)/wait_for_activation=Truehanging forever on hosts where no other client is subscribed to systemd signals - Fix
pystemd.runmissing unit state changes when several D-Bus signals arrive at once - Fix
pystemd.futureson Python 3.14+, where the default multiprocessing start method is no longer fork - Fix
pystemd.futuresignoringUser=on systemd >= 255 - Fix
pystemd.futures.TransientUnitPoolExecutorleaking its unit when the parent process is killed - Fix
pystemd.run(wait_for_activation=True)hanging forever when the unit fails to start - Add
delegate=topystemd.run, a shortcut forextra={"Delegate": ...} - Add
PrivatePIDs,ProtectHostnameExandSystemCallErrorNumberto systemd1 KNOWN_UNIT_SIGNATURES - Add
FileDescriptorStoreMaxandFileDescriptorStorePreserveto systemd1 KNOWN_UNIT_SIGNATURES - Add
fds=topystemd.daemon.notify(sd_pid_notify_with_fds) and addpystemd.daemon.listen_fds_with_names(file descriptor store / named socket activation) - Add
pystemd.daemon.store_fdandpystemd.daemon.store_fdshelpers for the file descriptor store - Add
OOMPolicy,OOMScoreAdjustand theManagedOOM*properties to systemd1 KNOWN_UNIT_SIGNATURES - Fix
Unit.SetPropertiesraisingNotImplementedError: it now encodes properties likeManager.SetUnitPropertiesdoes, and takes a dict or a list of (name, value) pairs (#122) - Add
CPUWeight,IOWeight,AllowedCPUs,MemoryMin, theIO*Maxlimits and other cgroup properties to systemd1 KNOWN_UNIT_SIGNATURES - Split
pystemd.utilsinto a package (pystemd.utils.{x2,unit,typing}); existing imports keep working - Add
pystemd.utils.ns.join_namespaces(atomic pidfdsetns, with a per-namespace fallback) - Fix
pystemd.futuresworkers leaking one fd per namespace, and silently running outside the unit's namespaces when one can't be joined: they now usepystemd.utils.ns.join_namespaces - Fix crashes in
pystemd.dbuslib:DbusMessage.get_path()/get_member()/ ... segfaulting on a header field the message lacks (they now returnNone),get_interface()returning the path,DBus.close()twice aborting and using a closed bus corrupting memory (it now raises), andDBusMachine/DBusRemotekeeping a dangling pointer to their name (they now also takestr) - Fix
DBus.match_signalnot keeping its callback alive and failing for bound methods; the callback no longer gets ametadataattribute DBusbuses are now freed when garbage collected; sd-bus errors while building a message, and unbalanced(in signatures, now raise instead of being ignored- Update the
Unittype stubs to systemd 259'sUnitandServiceinterfaces, and shippy.typedso type checkers use them (#71) - Document the file descriptor store,
delegate=,Unit.SetPropertiesandjoin_namespaces, and addexamples/fdstore_counter.py - Fix leaked D-Bus messages, errors and passed file descriptors when
DBus.call_methodorDBus.get_propertyfails - Fix
Manager.StartTransientUnit,Manager.SetUnitPropertiesandUnit.SetPropertiescalled on the object (manager.StartTransientUnit(...), notmanager.Manager.StartTransientUnit(...)) shifting their arguments and failing with anAssertionError(#120) - Add
DeviceAllowto systemd1 KNOWN_UNIT_SIGNATURES (#119); an unknown unit property now raises aKeyErrorthat says how to add its signature - Ship a PyInstaller hook, so apps frozen with PyInstaller work without adding pystemd's modules to
hiddenimports(#90) - Document how to start, stop, restart, enable, disable and mask units (the
systemctlequivalents), and addexamples/manage_units.py
pip install pystemd==0.16.0