jcorporation / mympd-scripts

Scripts for myMPD
https://github.com/jcorporation/myMPD
GNU General Public License v3.0
7 stars 2 forks source link

Scripting - executing shell command does not work #25

Open td598 opened 1 week ago

td598 commented 1 week ago

myMPD version: 18.0.0

I try to get script "JukeboxBlissify" to work. I installed everything neccessary and when I run the following command that is created in the script in a terminal it works great: /home/tc/.cargo/bin/blissify -c /home/tc/.config/bliss-rs/config.json playlist --seed-song --dry-run --from-song "/var/lib/mpd/music/A Tasty Sound Collection/Cigars & Sounds/01 His Hometown.flac" 52 2>/dev/null

Running this in the script does not work at all. "mympd.os_capture(cmd)" result is nil. Mympd message: "Failure adding songs to jukebox queue" I am aware of issue 399 but it did not work either.

Server platform (please complete the following information):

Client platform (please complete the following information):

jcorporation commented 1 week ago

You can try a simple script to check if mympd.os_execute works:

local output = mympd.os_capture("ls /")
return output

If this returns a filesystem listing, it is a script or blissify issue and not a general myMPD issue.

If this works, try:

local output =  mympd.os_capture("/home/tc/.cargo/bin/blissify -c /home/tc/.config/bliss-rs/config.json playlist --seed-song --dry-run --from-song '/var/lib/mpd/music/A Tasty Sound Collection/Cigars & Sounds/01 His Hometown.flac' 52")
return output

I removed the 2>/dev/null on purpose to not hide error messages.

td598 commented 6 days ago

Thank you for the fast answer. The first script worked nicely. The second again not at all. It only said "Skript test erfolgreich gestartet". In a terminal it worked though.

jcorporation commented 6 days ago

Any Output in the log? You run it under systemd? The default systemd unit has protecthome set to true.

Moving this issue to the mympd-script repo.

td598 commented 6 days ago

This is the output of the journalctl command: Oct 11 09:46:34 Test mympd[6000]: sh: 1: /home/tc/.cargo/bin/blissify: Permission denied I expected this to be an authorization topic. But to be honest I am not good with this and do not know how to solve.

jcorporation commented 6 days ago

Simply move the blissify installation out of your home directory. The default systemd unit of myMPD has ProtectHome set to true and this prevents myMPD accessing home directories.