I found a great post over 
at: 
http://stackoverflow.com/questions/11152657/angstrom-start-up-processes-beaglebone
 
on how to have a python script run on power up. 

My python code that displays text on an oled screen runs fine on Angstrom 
when I run it manually.

The web page says to:

Create a new file in /lib/systemd/system/ (rfidreader.service in my 
example) with a content like:

[Unit]
Description=Start Python RFID reader

[Service]
WorkingDirectory=/...Python script path.../
ExecStart=/usr/bin/python rfidreader.py
KillMode=process

[Install]
WantedBy=multi-user.target

Then execute the following command to install the service:

systemctl enable rfidreader.service

To start the service, you can reboot or execute

systemctl start rfidreader.service

To check if the service is running and get the latest outputs from the 
script:

systemctl status rfidreader.service



*My code:*
[Unit]
Description=Start Python Oled

[Service]
WorkingDirectory=/home/root/py-gaugette/samples/
ExecStart=/home/root/py-gaugette/samples/python new_test.py
KillMode=process

[Install]
WantedBy=multi-user.target

*My error message:*
root@beaglebone:~# systemctl status oled.service
oled.service - Start Python Oled
  Loaded: loaded (/lib/systemd/system/oled.service; enabled)
  Active: *failed* (Result: exit-code) since Tue 2014-05-13 00:12:38 GMT+3; 
23s ago
Process: 666 ExecStart=/home/root/py-gaugette/samples/python new_test.py 
*(code=exited, 
status=203/EXEC)*
  CGroup: name=systemd:/system/oled.service

May 13 00:12:38 beaglebone systemd[1]: Starting Start Python Oled...
May 13 00:12:38 beaglebone systemd[1]: Started Start Python Oled.
May 13 00:12:38 beaglebone systemd[1]: *oled.service: main process exited, 
code=exited, status=203/EXEC*
May 13 00:12:38 beaglebone systemd[1]: *Unit oled.service entered failed 
state*


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to