Skip to main content

Library for systemd.

Project description

python3-cyberfusion-systemd-support

Library for systemd.

Install

PyPI

Run the following command to install the package from PyPI:

pip3 install python3-cyberfusion-systemd-support

Next, ensure you are working on a system that ships systemd.

Debian

Run the following commands to build a Debian package:

mk-build-deps -i -t 'apt -o Debug::pkgProblemResolver=yes --no-install-recommends -y'
dpkg-buildpackage -us -uc

Configure

No configuration is supported.

Usage

Units

from cyberfusion.SystemdSupport.units import Unit

unit = Unit(f"example.{Unit.SUFFIX_SERVICE}")

unit.disable()
unit.stop()
unit.enable()
unit.restart()
unit.reload()

print(unit.is_active)
print(unit.is_enabled)
print(unit.is_failed)

Transient units

from cyberfusion.SystemdSupport.units import TransientUnit

transient_unit = TransientUnit.run(name="cf-apt-upgrade", command=["apt-get", "upgrade", "-y"])
transient_unit.clean_up()

Tmp files

from cyberfusion.SystemdSupport.tmp_files import TmpFileConfigurationLine, TmpFileConfigurationFile

tmp_file_configuration_line = str(TmpFileConfigurationLine(type_="d", path="/tmp/example", mode="0755", user="example", group="example"))
tmp_file_configuration_file = TmpFileConfigurationFile(path="/etc/tmpfiles.d/example.conf")

tmp_file_configuration_file.create()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python3_cyberfusion_systemd_support-2.5.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file python3_cyberfusion_systemd_support-2.5.0.tar.gz.

File metadata

File hashes

Hashes for python3_cyberfusion_systemd_support-2.5.0.tar.gz
Algorithm Hash digest
SHA256 e3ccbaa089cd27f4d90ab4c05a18812ee50cfae9fe9e5f5a6a948b0f45687fa3
MD5 73bec48e6832fa0e8c68815c062e769a
BLAKE2b-256 ee7e01724a52d786dd5c30c7245b5cb10028e0a849fdb0febfed20182dc2fbb2

See more details on using hashes here.

File details

Details for the file python3_cyberfusion_systemd_support-2.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python3_cyberfusion_systemd_support-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d8b85ab11b6b669b8b5e90ddc5882402cb683868aad2a362fc2fcd1106da1ec
MD5 47b0d9c07217ad140cc48c4f0385c421
BLAKE2b-256 1fc6511748aeff6ef659a257308165e7e2d3812f9be37c13e553b2e2f81471b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page