bluepr0 Posted March 20, 2019 Author Share Posted March 20, 2019 3 minutes ago, jonathanm said: Weird. So if you type just the portion inside the double quotes, what happens? /boot/config/plugins/user.scripts/scripts/StartVMs/script This root@xserver:~# /boot/config/plugins/user.scripts/scripts/StartVMs/script -bash: /boot/config/plugins/user.scripts/scripts/StartVMs/script: No such file or directory root@xserver:~# VERY WEIRD O_O Quote Link to comment
bluepr0 Posted March 20, 2019 Author Share Posted March 20, 2019 (edited) Also If I do root@xserver:~# cd /boot/config/plugins/user.scripts/scripts/StartVMs -bash: cd: /boot/config/plugins/user.scripts/scripts/StartVMs: No such file or directory root@xserver:~# I can get into scripts folder root@xserver:~# cd /boot/config/plugins/user.scripts/scripts/ root@xserver:/boot/config/plugins/user.scripts/scripts# ls -la total 56 drwxrwxrwx 7 root root 8192 Mar 20 12:59 ./ drwxrwxrwx 3 root root 8192 Mar 19 21:19 ../ drwxrwxrwx 2 root root 8192 Mar 20 12:59 StartVMs/ drwxrwxrwx 2 root root 8192 Mar 20 12:59 VMDelay/ drwxrwxrwx 2 root root 8192 Mar 19 21:14 delete.ds_store/ drwxrwxrwx 2 root root 8192 Mar 19 21:14 delete_dangling_images/ drwxrwxrwx 2 root root 8192 Mar 19 21:14 viewDockerLogSize/ root@xserver:/boot/config/plugins/user.scripts/scripts# But then I can't O_O root@xserver:/boot/config/plugins/user.scripts/scripts# cd StartVMs -bash: cd: StartVMs: No such file or directory root@xserver:/boot/config/plugins/user.scripts/scripts# I can get inside VMDelay root@xserver:/boot/config/plugins/user.scripts/scripts# ls StartVMs/ VMDelay/ delete.ds_store/ delete_dangling_images/ viewDockerLogSize/ root@xserver:/boot/config/plugins/user.scripts/scripts# cd VMDelay/ root@xserver:/boot/config/plugins/user.scripts/scripts/VMDelay# ls -la total 32 drwxrwxrwx 2 root root 8192 Mar 20 12:59 ./ drwxrwxrwx 7 root root 8192 Mar 20 12:59 ../ -rwxrwxrwx 1 root root 7 Mar 20 12:59 name* -rwxrwxrwx 1 root root 85 Mar 20 12:59 script* root@xserver:/boot/config/plugins/user.scripts/scripts/VMDelay# I will try to delete and add the script again Edited March 20, 2019 by bluepr0 Quote Link to comment
bluepr0 Posted March 20, 2019 Author Share Posted March 20, 2019 Alright removed it and added it back and now when I run the VMDelay it actually turns on the VMs (so it's triggering the other script). I will try restarting just to confirm it's finally working. Thanks! Quote Link to comment
JonathanM Posted March 20, 2019 Share Posted March 20, 2019 Cool, hopefully it stays working. That's some weird juju though, maybe do a checkdisk on the USB stick. Quote Link to comment
bluepr0 Posted March 20, 2019 Author Share Posted March 20, 2019 12 minutes ago, jonathanm said: Cool, hopefully it stays working. That's some weird juju though, maybe do a checkdisk on the USB stick. It seems to be working... yaaay! Thanks a lot!. Will do a check for sure, something weird happened for sure. Quote Link to comment
JonathanM Posted March 20, 2019 Share Posted March 20, 2019 1 minute ago, bluepr0 said: Will do a check for sure, something weird happened for sure. The good thing to come out of all this is that you know how to set up scripts, and what they can and can't do on startup. It's pretty simple really, a script can be just a list of commands you could type at the command line, but don't particularly want to type over and over again manually. You can start dockers, VM's, do pretty much anything with a script. 1 1 Quote Link to comment
iarp Posted January 10, 2021 Share Posted January 10, 2021 Are there any recommended changes to these scripts now that unraid no longer allows executing scripts off of the boot device? Basically all I'm getting now is the following error because you cannot execute a script from that location anymore. I'm not entirely sure if the array is fully available to put the script in my system share either. sh: line 19: /boot/config/plugins/user.scripts/scripts/StartVMs/script: Permission denied Quote Link to comment
Squid Posted January 10, 2021 Share Posted January 10, 2021 22 minutes ago, iarp said: Are there any recommended changes to these scripts now that unraid no longer allows executing scripts off of the boot device? Basically all I'm getting now is the following error because you cannot execute a script from that location anymore. I'm not entirely sure if the array is fully available to put the script in my system share either. sh: line 19: /boot/config/plugins/user.scripts/scripts/StartVMs/script: Permission denied User scripts executes its scripts differently, so that error is basically impossible to happen, unless you're trying to execute that script from within another script of user scripts. In that case you would change your script to execute it like /bin/bash /boot/config/plugins/user.scripts/scripts/StartVMs/script Quote Link to comment
iarp Posted January 10, 2021 Share Posted January 10, 2021 On this comment he mentions it being two scripts, one that starts at array start which in turn starts the other script. I changed it to your command and it works when I run script on the initial script. Thanks. Quote Link to comment
JonathanM Posted January 10, 2021 Share Posted January 10, 2021 1 hour ago, iarp said: On this comment he mentions it being two scripts, one that starts at array start which in turn starts the other script. I changed it to your command and it works when I run script on the initial script. Thanks. The two script workaround may not be needed any more, I haven't bothered to investigate. A lot of things have changed in Unraid since that writeup. Quote Link to comment
Jokerigno Posted January 15, 2021 Share Posted January 15, 2021 (edited) On 1/10/2021 at 6:35 PM, jonathanm said: The two script workaround may not be needed any more, I haven't bothered to investigate. A lot of things have changed in Unraid since that writeup. What? Can you please point us to the new simplest solution? TY! In the meatime I share my customized solution. I had to use NC installing netcat-openbsd-1.105 from Nerd Pack in order to be able to test a web server on a specific port. My script is this now: #!/bin/bash printf "%s" "waiting for ZoneMinder ..." # Change IP to match an address controlled by ZoneMinder. # I recommend ZoneMinder internal gateway or some address guaranteed to be up when ZoneMinder is finished loading. # I don't use external IP's because I want my internal network and appliances to be fully available # whether the internet is actually connected or not. while ! nc -vz 192.168.2.100 8088 &> /dev/null do printf "%c" "." done printf "\n%s\n" "ZoneMinder is back online" sleep 10 virsh start Hass.io # Insert optional delay to stagger VM starts #sleep 30 #virsh start VMName2 I use it to start my Home Assistant VM after basics dockers are online (MQTT, DECONZ, MARIADB and ZONEMINDER) Edited January 15, 2021 by Jokerigno Quote Link to comment
Jokerigno Posted February 26, 2021 Share Posted February 26, 2021 On 1/10/2021 at 6:35 PM, jonathanm said: The two script workaround may not be needed any more, I haven't bothered to investigate. A lot of things have changed in Unraid since that writeup. @jonathanm @Squid @iarp any feedback on how to do this now? My StartVMs works but it's not trigged by Delay VM Start #!/bin/bash echo "/boot/config/plugins/user.scripts/scripts/StartVMs/script" | at now Thank you Quote Link to comment
DrLucasMendes Posted May 25, 2021 Share Posted May 25, 2021 On 2/26/2021 at 11:31 AM, Jokerigno said: @jonathanm @Squid @iarp any feedback on how to do this now? My StartVMs works but it's not trigged by Delay VM Start #!/bin/bash echo "/boot/config/plugins/user.scripts/scripts/StartVMs/script" | at now Thank you I changed the line echo "/boot/config/plugins/user.scripts/scripts/StartVMs/script" | at now to /bin/bash /boot/config/plugins/user.scripts/scripts/StartVMs/script So I can trigger the other script. However be aware that you can use just the second script (the big one) with "At Startup of Array" option I hope I was able to assist. All the best, Lucas Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.