On 7/8/21 11:29 AM, John Murphy wrote:
On Thu, 8 Jul 2021 08:56:56 -0700 Fernando
Lopez-Lezcano wrote:
On 7/7/21 11:24 AM, John Murphy wrote:
On Wed, 7 Jul 2021 19:01:25 +0100 Keith Edmunds
wrote:
Try:
/usr/bin/pw-record /home/john/crontest.wav > /tmp/cronjob.txt 2>&1
...and have a look in /tmp/cronjob.txt after it's run
/tmp/cronjob.txt says error: pw_context_connect() failed: Host is down
I've no idea what that means, or why that should be so.
https://docs.pipewire.org/group__pw__core.html
----
Connect to a PipeWire instance.
Returns
a The Core Global Object on success or NULL with errno set on
error. The core will have an id of PW_ID_CORE (0)
----
So it would seem that the pipewire client cannot connect to the server
(or something like that). Could be ownership, permissions, even selinux
if it is running.
Thanks for the thoughts. There are some selinux libs installed,
but not much else. I added a job to /etc/crontab like:
04 19 * * * root /usr/bin/pw-record /home/john/crontest.wav > /tmp/cronjob.txt
2>&1
and see the same error in the text file.
Maybe running as root is actually not enough :-(
I don't know how to fix this but it is likely that this does not
establish a "session" (or "seat") and then dbus is not running and
then
nothing that depends on it can work. Maybe running the cron job as a
normal user? I don't know how you can convince the system that you
really are allowed to do all this...
< and if selinux is involved, maybe you can look at what is in the logs?
/var/log/secure, /var/log/messages, and hunt for denials or permission
problems? >
-- Fernando
It could also
be that running things from cron does not establish a
"session" and then you do not have access permission to audio devices
and such (and dbus, as suggested elsewhere in the thread).
It's a long time since I've used root for anything, but I think it
would still have the required permissions to do anything. I begin to
wonder if this is by design, but I still don't know if it works for
anyone else.