You are not logged in.
Pages: 1
Hi
I am using cronie.
I tested cvlc to run an audio file. My laptop had just restarted and I hadnt login to my user account. But the croned application didnt run.
Do I have to be logged in, so that applications execute?
Thankyou
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
cvlc connects to the session bus, are you sure the job didn't run or did you just not hear music? Try eg. mpg123/ogg123…
Offline
Hi
I tried with mpg123.
Please note I dont use the Login Manager, so after startup and no login, I am having tty1 only. Perhaps this is the issue.
Edit 1: It worked with cron of root. But I didnt intended to use the root for playing an audio! I think it is not the correct way. This is not a root's job.
Thankyou
Last edited by makh (2019-01-02 19:37:09)
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
Neither needs a display server, nor do you have to be logged in.
It's most likely an issue w/ accessing the audio device, make the call
mpg123 /path/to/music.mp3 > /tmp/mpg123.log 2>&1
Offline
Hi
Theres some problem:
cat mpg123.log
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.25.10; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
Thankyou
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
Is that all?
It doesn't look as if any error messages were logged, but at least you know the issue is w/ the playback, not w/ the cronjob.
Try
sudo useradd dummy
sudo -u dummy mpg123 /path/to/music.mp3
sudo userdel dummy # NOT if you actually have a dummy account ;-)
to simulate a playback for a non-active user, you'll likely get some alsa or pulseaudio errors.
Offline
Hi
Let me try with the sudo account. It isnt different from the root account.
But it still doesnt make sense...
From your points: I think that as my user session is inactive due to fresh bootup; so the audio fails to play!
Thankyou
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
Nono, the idea is to create a "dummy" user (with that username ;-) and sudo as that inprivilegued user (-u dummy) to generate some output.
You've to be still logged in to have an active session, but yeah, the idea is that the audio device access struggles at some point - you might be able to adjust a polkit rule for this.
Offline
Hi
I didnt use your technique; as I use a sudo user already for some tasks. It is a user apart from my routine user.
Anyhows... sudo user didnt worked! I dont intend to try further as root is doing the task, and I dont want to playing with polkit or other advance configurations.
Thankyou
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
There is no "sudo user" and that's not the point at all.
I'm trying to sell you the idea to create an unprivilegued user to use it w/o bein logged in to provoke the same failure in mpg123 to get the required error messages you somehow couldn't generate w/ a cronjob modification so that we can see *why* an inactive user cannot play music so that we can start to figure how to fix that.
Offline
Hi
This is without cron:
sudo -u dummy mpg123 /home/path/music.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.25.10; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
Failed to create secure directory (/home/dummy/.config/pulse): No such file or directory
Failed to create secure directory (/home/dummy/.config/pulse): No such file or directory
Failed to create secure directory (/home/dummy/.config/pulse): No such file or directory
Segmentation fault
Thankyou
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
So pulseaudio and that already stumbles on the missing home directory.
Since that won't be the problem w/ your main user, we need to fix that:
sudo mkdir /home/dummy
sudo chown dummy:users /home/dummy
sudo -u dummy mkdir /home/dummy/.config
sudo -u dummy mpg123 /home/path/music.mp3
Offline
Hi
The above steps done...
I copied the file to home of dummy, and logged in via root:
mpg123 002.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.25.10; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
Segmentation fault (core dumped)
$ pwd
/home/dummy
Via sudo user:
sudo -u dummy mpg123 /home/dummy/002.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.25.10; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
Segmentation fault
Thankyou
Last edited by makh (2019-01-06 16:51:14)
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
man coredumpctl
Offline
Hi
coredumpctl -1
TIME PID UID GID SIG COREFILE EXE
Thu 2019-01-10 16:39:29 PKT 7599 1003 1003 11 error /usr/bin/mpg123
Thankyou
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
Well, it would certainly be interesting to look into the coredump, don't you think?
Offline
Hi
coredumpctl -1 info
PID: 21723 (mpg123)
UID: 1003 (dummy)
GID: 1003 (dummy)
Signal: 11 (SEGV)
Timestamp: Fri 2019-01-11 18:17:26 PKT (5s ago)
Command Line: mpg123 002.mp3
Executable: /usr/bin/mpg123
Control Group: /user.slice/user-1000.slice/session-c1.scope
Unit: session-c1.scope
Slice: user-1000.slice
Session: c1
Owner UID: 1000 (myuser)
Boot ID: 4dd64fb9c21d4707a63785db1db3f330
Machine ID: 5b06db0af3da42818af7b0466f6abc6a
Hostname: arch1
Storage: /var/lib/systemd/coredump/core.mpg123.1003.4dd64fb9c21d4707a63785db1db3f330.21723.1>
Message: Process 21723 (mpg123) of user 1003 dumped core.
Stack trace of thread 21723:
#0 0x00007f95e115dfd0 n/a (n/a)
Thankyou
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
Does the strace seriously end after that call?
Offline
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
OK, PA isn't supposed to run as system-wide service according to https://www.freedesktop.org/wiki/Softwa … ystemWide/ so no surprise inactive users cannot play anything…
My suggestion for a solution would revolve around PA and lennarts gluteus maximus, but it seems possible to run PA as system-wide service https://unix.stackexchange.com/question … md-service - pay attention to the "auth-anonymous=1" and good luck.
Offline
Pages: 1