0

I am trying to run a python script on boot in a jetson nano. However, I think my script is not running for some reasons and I have no idea what is going on. Can any master help me out?

I am trying to make a python script to run on boot on a jetson nano. Here is my python script and my service:

startup.service:

[Unit]

Description = INTU_IPC start-uo specific script

[Service]

Type= idle

ExecStartPre = /bin/sleep 10

ExecStart = /usr/local/bin/startup.sh

User=jetbot

[Install]

WantedBy = multi-user.target

startup.sh:

#! /bin/sh
sleep 10
OPENBLAS_CORETYPE=ARMV8 /usr/bin/python3 ~/py_basics/helloworld.py

helloworld.py:

#!/usr/bin/env python3
print("Hello World!")

I used the following command in terminal to enable my startup.service: sudo systemctl enable startup.service sudo systemctl start startup.service

However, when I try to restart my jetson nano, and I tracked the activities of my service with the systemclt status startup.service in the terminal, I think the following lines showed my service is not running.

jetbot@jetson-4-3:~$ systemctl status startup.service
● startup.service - INTU_IPC start-uo specific script
   Loaded: loaded (/etc/systemd/system/startup.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2023-05-24 18:40:13 PDT; 1min 3s ago
  Process: 6345 ExecStart=/usr/local/bin/startup.sh (code=exited, status=203/EXEC)
  Process: 4094 ExecStartPre=/bin/sleep 10 (code=exited, status=0/SUCCESS)
 Main PID: 6345 (code=exited, status=203/EXEC)

May 24 18:39:57 jetson-4-3 systemd[1]: Started INTU_IPC start-uo specific script.
May 24 18:40:13 jetson-4-3 systemd[6345]: startup.service: Failed to execute command: Permission denied
May 24 18:40:13 jetson-4-3 systemd[6345]: startup.service: Failed at step EXEC spawning /usr/local/bin/startup.sh: Permission denied
May 24 18:40:13 jetson-4-3 systemd[1]: startup.service: Main process exited, code=exited, status=203/EXEC
May 24 18:40:13 jetson-4-3 systemd[1]: startup.service: Failed with result 'exit-code'.

Can anyone help me with this?

1 Answers1

0

Thank you for the help.

I found out that is was some permission problems which I solved it with by changing the permission of the startup.sh with this code executed in the terminal:

sudo chmod +x /usr/local/bin/startup.sh

However, there are still some problems in importing libraries and modules while running python scripts on jetson nano.