Go Down

Topic: OpenWRT - Start a python script at boot. (Read 1 time) previous topic - next topic


Hey, I have a python script with an infinite loop which adds data too a database while the system is on, my script works i have tested it via SSH. but i cant seem to get the script too either be started at boot by the process library or by the OpenWRT's rc.local or init.d files or find any information on why it is not working.

heres my rc.local file

Code: [Select]
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.


[u]python /mnt/sda1/arduino/www/x/app.py &[/u]

# Uncomment the following line in order to reset the microntroller
# right after linux becomes ready


# Uncomment the following line in order to disable kernel console
# debug messages, thus having a silent and clean serial communication
# with the microcontroller

#echo 0 > /proc/sys/kernel/printk

exit 0


Jan 08, 2016, 12:54 am Last Edit: Jan 08, 2016, 12:55 am by sonnyyu
Put shebang line (#!/usr/bin/python) at header of app.py

Code: [Select]
chmod 755 /mnt/sda1/arduino/www/x/app.py

Code: [Select]
opkg update
opkg install coreutils-nohup


Code: [Select]
/usr/bin/nohup /root/freerun.py &

put  "/usr/bin/nohup /mnt/sda1/arduino/www/x/app.py &"  at rc.local file.


Put shebang line (#!/usr/bin/python) at header of app.py

Code: [Select]
chmod 755 /mnt/sda1/arduino/www/x/app.py

put  "/usr/bin/nohup /mnt/sda1/arduino/www/x/app.py &"  at rc.local file.

when I try to install no nohup I get error saying:

Code: [Select]

root@iduino:~# opkg install coreutils-nohup
Unknown package 'coreutils-nohup'.
Collected errors:
 * opkg_install_cmd: Cannot install package coreutils-nohup.


Mar 11, 2017, 01:36 am Last Edit: Mar 11, 2017, 01:36 am by sonnyyu

Packages List
The list of available packages for the Yún is available here.
See the list of changes.


coreutils-nohup_8.16-1_ar71xx.ipk  is here.

Code: [Select]
opkg  update
opkg install coreutils-nohup

Plan B:

if failed please pull source of coreutils-nohup then compile it.

Go Up