Jump to content

Recommended Posts

Posted (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 by check
Posted

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.

Posted

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

 

Posted

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?

Posted
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 ?

Posted

@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

Posted (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 by bedna

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines