systemd / pystemd

A thin Cython-based wrapper on top of libsystemd, focused on exposing the dbus API via sd-bus in an automated and easy to consume way.
GNU Lesser General Public License v2.1
411 stars 36 forks source link

centos7 not supported #4

Closed grubberr closed 5 years ago

grubberr commented 6 years ago

Hello,

I just tried to install pystemd on centos 7.5.1804 but it failed because of

[root@newvirt7 ~]# pip3 install pystemd
...
pystemd/dbuslib.c:582:28: fatal error: systemd/sd-bus.h: No such file or directory

all systemd packages installed

[root@newvirt7 ~]# rpm -qa | grep -i systemd  
systemd-219-57.el7.x86_64
systemd-libs-219-57.el7.x86_64
systemd-devel-219-57.el7.x86_64
systemd-sysv-219-57.el7.x86_64

is it not supported on purpose ? Thanks

davide125 commented 6 years ago

pystemd requires a version of systemd that provides sd_bus (meaning >= v221). We maintain a systemd backport for CentOS at https://github.com/facebookincubator/rpm-backports tracking the latest stable release, and community-provided prebuilt packages are available at https://copr.fedorainfracloud.org/coprs/jsynacek/systemd-backports-for-centos-7/

aleivag commented 6 years ago

Yes as @davide125 mention, we use systemd/sd_bus.h to communicate with systemd, that way our library retains compatibility with the version of systemd and dbus that you are using, (the logic is that if systemd works, then should pystemd). This library was introduced in systemd in v221 (the blog post is: http://0pointer.net/blog/the-new-sd-bus-api-of-systemd.html).

Most modern distribution have modern version of systemd (currently we are in v238), but centos7 ships with 219 that is kind of old.

if you want to play in centos7, @davide125 's comments are the way to go.

with that said, i think we should add a special note on the README, on why centos7 is not supported (after all it is the latest version of centos), and some suggestion on getting it to work.

thanks @grubberr for bringing this to our attention.

flokli commented 5 years ago

This can be closed, and we should probably should merge #11 too…

davide125 commented 5 years ago

11 has been merged