[Libguestfs] guestfs_launch() fails when C application is started as a systemd service

Peter Dimitrov peterd at telco.com
Fri Nov 2 16:04:08 UTC 2018


Hello,

I have a simple C program that uses libguestfs to extract info about disk
usage from a libvirt domain. It works when ran manually as root, but fails
when started as a systemd service.

I'm attaching the service file, source code and verbose logs from both the
successful manual run and from the service journal.

SELinix is disabled.

Error messages:
libguestfs: set_socket_create_context: getcon failed: (none): Invalid
argument [you can ignore this message if you are not using SELinux + sVirt]
libguestfs: clear_socket_create_context: setsockcreatecon failed: NULL:
Invalid argument [you can ignore this message if you are not using SELinux
+ sVirt]
libguestfs: error: chown: /tmp/libguestfsvMMaec/guestfsd.sock: Operation
not permitted
libguestfs: clear_socket_create_context: setsockcreatecon failed: NULL:
Invalid argument [you can ignore this message if you are not using SELinux
+ sVirt]
libguestfs: trace: launch = -1 (error)
failed to launch domain: Invalid argument

(Note on the service file: CapabilityBoundingSet is for future development
- it seems to make no difference)

Best Regards,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20181102/d23fd35b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 2932 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20181102/d23fd35b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_guestfs.service
Type: application/octet-stream
Size: 353 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20181102/d23fd35b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: systemd_failing.log
Type: text/x-log
Size: 21436 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20181102/d23fd35b/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: manual_working.log
Type: text/x-log
Size: 106880 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20181102/d23fd35b/attachment-0002.bin>


More information about the Libguestfs mailing list