orangepinoob756 Posted August 12, 2023 Posted August 12, 2023 Hi @all, i built this: https://www.instructables.com/DIY-Lyric-Monitor-for-Stage/ running armbian-OS. In order to have an external power switch, i made this: using pin 7 and gnd and it works! the script is successfully doing a shutdown. but, to run that program ("pushbuttons.c" compiled to "pushbuttons") in anything other than root, he wants the password. and i really dont know how to add it to autostart (in "settings"), because i dont know how to fill in the "command" field. like "sudo ./program"? Thank you so much für any help. 0 Quote
going Posted August 13, 2023 Posted August 13, 2023 13 часов назад, orangepinoob756 сказал: In order to have an external power switch, i made this: 13 часов назад, orangepinoob756 сказал: using pin 7 and gnd and it works! the script is successfully doing a shutdown. Do you want to make an external power switch in this way? Do you want to send a signal to one of the pins of connector 40? Do you want the device to turn off? But at the same time, will the 5V power supply to the device be sold? There are pitfalls here. Are you interested in knowing them? And how will the external activation of the device be carried out? 0 Quote
orangepinoob756 Posted August 13, 2023 Author Posted August 13, 2023 Hi, thank you for answering! All of those pitfalls are solved. My only problem is: How will the program (file named "pushbuttons") that launches the shutdown-script be launched at every startup? the account that starts by default in the pre-made armbian-image is not root. and as i am no expert in linux, i dont know how it is going to be implemented in the autostart list? which command should be given? the gui lets me choose the autostart-program, but at launch, it won't load. 0 Quote
going Posted August 13, 2023 Posted August 13, 2023 31 минуту назад, orangepinoob756 сказал: and as i am no expert in linux, i dont know how it is going to be implemented in the autostart list? how-to-run-scripts-on-start-up run-script-boot-up-debian 0 Quote
bedna Posted August 14, 2023 Posted August 14, 2023 (edited) My gut feeling was using systemd to run the script, that way root, or in this case systemd issues the commands. If it is to be run at startup just enable the service and specify `After` and `required` options. Not sure how you call the script, but you can probably play around it. https://www.freedesktop.org/software/systemd/man/systemd.service.html Bonus is you get access to journalctl that logs what is going on, extremely useful when debugging. Edited August 14, 2023 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.