- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi, I put a python program on root/ . I am wondering how could I let edison to run the program when it power on?
Many thanks
Hao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Hao,
You can create a script to run at boot. Take a look at the following threads:
I wrote an example on where I had a blink.py in /home/root
root@edison:~# vi script.sh
# !/bin/sh
/usr/bin/python /home/root/blink.py
In order to make it an executable
root@edison:~# chmod +x script.sh
Then, you must create the service
root@edison:~# vi /lib/systemd/system/blinkpy.service
# !/bin/sh
[Unit]
Description=Blink with Python
After=network.target
[Service]
ExecStart=/home/root/script.sh
Environment="HOME=/home/root"
WorkingDirectory=/home/root/
[Install]
WantedBy=multi-user.target
Finally, you need to start and enable the service
root@edison:~# systemctl daemon-reload
root@edison:~# systemctl start blinkpy.service
root@edison:~# systemctl enable blinkpy.service
Regards,
Charlie
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Hao,
You can create a script to run at boot. Take a look at the following threads:
I wrote an example on where I had a blink.py in /home/root
root@edison:~# vi script.sh
# !/bin/sh
/usr/bin/python /home/root/blink.py
In order to make it an executable
root@edison:~# chmod +x script.sh
Then, you must create the service
root@edison:~# vi /lib/systemd/system/blinkpy.service
# !/bin/sh
[Unit]
Description=Blink with Python
After=network.target
[Service]
ExecStart=/home/root/script.sh
Environment="HOME=/home/root"
WorkingDirectory=/home/root/
[Install]
WantedBy=multi-user.target
Finally, you need to start and enable the service
root@edison:~# systemctl daemon-reload
root@edison:~# systemctl start blinkpy.service
root@edison:~# systemctl enable blinkpy.service
Regards,
Charlie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page