|
1 | 1 | python-systemd |
2 | 2 | =============== |
3 | 3 |
|
4 | | -Python module for native access to the systemd facilities in recent versions |
5 | | -of Fedora and other distributions. In particular, this capability includes |
6 | | -passing key/value pairs as fields that the journal can display and use for |
7 | | -filtering. There are also utilities to forward journal entries to aggregators |
8 | | -like Graylog2 via GELF. |
| 4 | +Python module for native access to the systemd facilities. Functionality |
| 5 | +is seperated into a number of modules: |
| 6 | +- systemd.journal supports sending of structured messages to the journal |
| 7 | + and reading journal files, |
| 8 | +- systemd.daemon wraps parts of libsystemd useful for writing daemons |
| 9 | + and socket activation, |
| 10 | +- systemd.id128 provides functions for querying machine and boot identifiers |
| 11 | + and a lists of message identifiers provided by systemd, |
| 12 | +- systemd.login wraps parts of libsystemd used to query logged in users |
| 13 | + and available seats and machines. |
9 | 14 |
|
10 | 15 | Installation |
11 | 16 | ============ |
12 | 17 |
|
| 18 | +This module should be packaged for almost all Linux distributions. Use |
| 19 | + |
| 20 | +On Fedora/RHEL/CentOS |
| 21 | + |
| 22 | + dnf install python-systemd python3-systemd |
| 23 | + |
| 24 | +On Debian/Ubuntu/Mint |
| 25 | + |
| 26 | + apt-get install python-systemd python3-systemd |
| 27 | + |
| 28 | +To build from source |
| 29 | + |
13 | 30 | On Fedora 17+ with Python 2: |
14 | 31 |
|
15 | | - sudo yum install git python-pip gcc python-devel systemd-devel |
| 32 | + sudo dnf install git python-pip gcc python-devel systemd-devel |
16 | 33 | pip-python install git+http://github.com/systemd/python-systemd.git#egg=systemd |
17 | 34 |
|
18 | 35 | On Fedora 17+ with Python 3: |
19 | 36 |
|
20 | | - sudo yum install git python3-pip gcc python3-devel systemd-devel |
| 37 | + sudo dnf install git python3-pip gcc python3-devel systemd-devel |
21 | 38 | pip-python3 install git+http://github.com/systemd/python-systemd.git#egg=systemd |
22 | 39 |
|
23 | 40 | Usage |
@@ -64,8 +81,7 @@ Quick way to view output with all fields as it comes in: |
64 | 81 | Test Builds (for Development) |
65 | 82 | ============================= |
66 | 83 |
|
67 | | - python setup.py build |
68 | | - cd builds/lib.* |
| 84 | + python setup.py build_ext -i |
69 | 85 | python |
70 | 86 | >>> from systemd import journal |
71 | 87 | >>> journal.send("Test") |
0 commit comments