March 9, 20179 yr I would like to execute a python script every time the server boots. How can I achieve this? Thanks
March 9, 20179 yr Community Expert Nerd Tools plugin to install python. User Scripts plugin to schedule your script for boot.
March 10, 20179 yr 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.
March 10, 20179 yr Array Start happens whenever the array is started. IE: will happen late in the boot process and and every stop / restart of the array.
March 10, 20179 yr 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.
March 10, 20179 yr 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
March 10, 20179 yr 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!
June 1, 20224 yr 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
May 17, 20233 yr 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! 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 May 17, 20233 yr by cholzer
May 17, 20233 yr 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).
May 17, 20233 yr 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.
October 11, 20232 yr 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 October 11, 20232 yr 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.