check Posted January 23 Posted January 23 (edited) Is there some shell script file inside /boot directory that gets called on system startup? Alternatively, is there any way to make such a script run by modifying only files inside /boot (like some config setting)? Edited January 23 by check 0 Quote
RockBian Posted January 23 Posted January 23 The file /boot/armbian_first_run.txt is sourced by a bash script (/usr/lib/armbian/armbian-firstrun-config), but only if the file /root/.not_logged_in_yet exists. 1 Quote
Igor Posted January 23 Posted January 23 Armbian still supports /etc/rc.local startup way: #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. YOUR_COMMAND exit 0 0 Quote
xuraax Posted March 7 Posted March 7 i have installed a minimal Armbian OS on my s905 box with the intention of running a python3 program directly at startup. Since this program makes use of Tkinter i had to install an Xfse Desktop in order for Tkinter to function. I am able to run my python3 program from command line after the Desktop comes up. I have included my python command namely: python3 -m bCNC as suggested above before the "exit 0" line in the rc.local file. This did not appear to have any effect at all. the system just boots to the Desktop. I actually am not interested at all in using this system for anything besides my program. Can i have some advice on what I can do to get this to work? 0 Quote
going Posted March 7 Posted March 7 1 час назад, xuraax сказал: I have included my python command namely: python3 -m bCNC as suggested above before the "exit 0" line in the rc.local file. Maybe so? python3 -m bCNC & Is the bCNC module visible in PYTHONPATH ? 0 Quote
xuraax Posted March 7 Posted March 7 @going, since my last message I continued investigating and I have managed to get it to work. I had tried the "&" suggestion but that did not work in my case probably for the following reason. bCNC uses graphics through Tkinter which in itself requires a GUI to be already invoked. It seems rc.local, and I also suspect crontab, are started before the GUI is invoked so I think this is why my program did not start. Of course it would have helped if I had been given some error message! The solution was to create a .desktop file at ~/.config/autostart/ . The bCNC.desktop file needs to contain the EXEC line formatted as follows: Exec=/usr/bin/python3 /home/xxx/.local/bin/bCNC Note that the full path is required and, strangely, the "-m" option needs to be removed. regards 0 Quote
bedna Posted March 19 Posted March 19 (edited) Well, you DID ask for a way to run a script, not a gui desktop application. Glad you figured it out. On 3/7/2024 at 5:23 PM, xuraax said: Note that the full path is required and, strangely, the "-m" option needs to be removed. Did you check what that option does? Quote -m module-name Searches sys.path for the named module and runs the correspond‐ ing .py file as a script. This terminates the option list (fol‐ lowing options are passed as arguments to the module). And you removed the invocation of bCNC so, not that strange. Edited March 19 by bedna 0 Quote
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.