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.

Run a script at boot

Featured Replies

I would like to execute a python script every time the server boots. How can I achieve this? Thanks

  • Community Expert

Nerd Tools plugin to install  python.

 

User Scripts plugin to schedule your script for boot.

  • Author

I have python installed and the script works manually. I installed the user scripts plugin. I see an option to run script at "Array Start" but not at system boot. Is it safe to assume array start will happen at system boot? I just installed unraid right before making this thread, so I am not very familiar with it yet. Thanks.

Array Start happens whenever the array is started.  IE: will happen late in the boot process and and every stop / restart of the array.

  • Author
Just now, Squid said:

Array Start happens whenever the array is started.  IE: will happen late in the boot process and and every stop / restart of the array.

 

So would you go with array start, or is there a better way to run script at boot? Thank you.

Array start means that all plugins, etc are installed, so that would be the best.  An alternative to only run at boot is to manually add the command to the /boot/config/go file

  • Author
1 minute ago, Squid said:

Array start means that all plugins, etc are installed, so that would be the best.  An alternative to only run at boot is to manually add the command to the /boot/config/go file

Thanks!

  • 5 years later...

I needed ctrl-alt-del disabled on Unraid as well. Kept trying to login to my VM using it, without first remembering to bind the keyboard to the VM. Which would of course reboot the Unraid host instead.

 

What I added to /boot/config/go ->

 

# Disable ctrl-alt-del on Unraid host
sed -i 's/ca::ctrlaltdel/# ca::ctrlaltdel/' /etc/inittab
/sbin/telinit q

 

 

  • 11 months later...
On 3/10/2017 at 4:08 PM, Squid said:

An alternative to only run at boot is to manually add the command to the /boot/config/go file

I am very sorry to necro this old thread but I could really need help with this.

I want promtail to launch at boot so that it can start to send logs to my log collection server.

For this I added the following to /boot/config/go

 

cp /boot/tools/promtail/promtail /usr/local/bin/promtail
chmod +x /usr/local/bin/promtail
/usr/local/bin/promtail -config.file /boot/tools/promtail/promtail-local-config.yaml	 

/usr/local/bin/promtail -config.file /etc/promtail/promtail-local-config.yaml

 

Result: promtail starts at boot and starts to send logs! :D


Problem: on the monitor connected to the unraid machine I now see the promtail output - I nolonger have access to the unraid GUI :(

Is there a way to start promtail "in the background?" inside the go file?
I could I could use the userscript plugin, but then I can only start the script when the array starts - should the array fail to start or anything else bad happens then I dont get logs of that. So I would really like to launch promtail on boot.

I tried to launch it with nohup but that did not solve it

Edited by cholzer

  • Community Expert
2 hours ago, cholzer said:

Is there a way to start promtail "in the background?" inside the go file?

 

Have you tried adding an & to the end of the command (as is used when launching emhttp in the background from the go file).

1 hour ago, itimpi said:

Have you tried adding an & to the end of the command

 

thank you for the suggestion!
sadly that does not work, promtail still takes control over what is displayed on the unraid machine's monitor.

  • 4 months later...

No personal experience with promtail, but ... have you tried redirecting the STDOUT / STDERR to somewhere?

 

/usr/local/bin/promtail -config.file /etc/promtail/promtail-local-config.yaml > /dev/null 2> &1

 

Above example will (attempt to) redirect STDOUT to /dev/null (i.e. "oblivion") and STDERR to "follow the footsteps STDOUT is going".

 

Of course, the script / app can try to forcibly write stuff on terminal, but doing that is generally avoided to maximize compatibility; it is completely possible that

  • there actually might be no terminal - it can be a true figment of script's imagination
  • the user might actually know better where to put any kind of output (personally I might just target STDERR to something like /dev/tcp/errorlogginghost/666
  • or ... whatever etc.

 

Edited by CleverestEU

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.

Guest
Reply to this topic...

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.