stroom wrote: > Actually, MusicMagicServer runs after reboot. > But if I copy the following crontab entries in crontab with crontab -e > (with change of the time for testing) the MusicMagicServer does not stop > or start > > > 0 4 * * * /home/pi/MusicIP/MusicMagicMixer/mmserver stop > 1 4 * * * /home/pi/MusicIP/MusicMagicMixer/mmserver start > > If I run the command "/home/pi/MusicIP/MusicMagicMixer/mmserver stop" > directly in the commandline, it prompts for su password > It's because you have "su - $USER -c" in your script, and not sudo instead of su, as in frankd script. su prompts for a password, that's certainly why it doesn't work in the crontab, there's no password entered at run time. At boot, because the user that runs mmserver script is root, the su command doesn't ask for a password to run the job as pi (I didn't know it, I just tried it). sudo works differently. It doesn't ask for a password if there is a rule in file /etc/sudoers that says so. /etc/sudoers is the rules file that says how to deal with sudo commands, according to users and commands. I didn't changed anything to this file. I have the original script (with su) and I had the same problems. So I changed the crontab with this :
Code: -------------------- 0 1 * * * sudo service mmserver stop 5 1 * * * sudo service mmserver start -------------------- stroom wrote: > f I run "sudo -u pi /home/pi/MusicIP/MusicMagicMixer/MusicMagicServer > stop & > /dev/null 2>&1", in the commandline it works as well, without > prompting for a password. > It's strange, it doesn't work for me, I have the message "Sorry, user pi is not allowed to execute .." LMS 7.9.0 on Linux Mageia 5 and RPI 3 1 SB3, 2 radio, 1 touch Plugins : Trackstat, Smartmix, MusicIP, ... ------------------------------------------------------------------------ Antoniop's Profile: http://forums.slimdevices.com/member.php?userid=39292 View this thread: http://forums.slimdevices.com/showthread.php?t=106958 _______________________________________________ plugins mailing list plugins@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/plugins