Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Boot order/priority for VMs and Dockers

Featured Replies

  • Author
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

  • Author

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 by bluepr0

  • Author

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!

 

Cool, hopefully it stays working. That's some weird juju though, maybe do a checkdisk on the USB stick.

  • Author
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.

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 year later...

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

 

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

 

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.

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.

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 by Jokerigno

  • 1 month later...
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

 

 

  • 2 months later...
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

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.