Jetson TK1 - How to Add Startup Application?(I want to execute it right after booting up)

Hello. I’m making Rover Car with Jetson TK1 and Pixhawk(Drone Flight Controller)

I have to run Startup Python Script on Jetson TK1.

My Python Script is

/home/ubuntu/Drone/AutoRun.py

:

import pygame

LandingFile = ‘/home/ubuntu/DroneChallenge/Voice/Landing.mp3’
PythonScriptsLauchingMP3File = ‘/home/ubuntu/DroneChallenge/Voice/PythonScriptsHasBeenLaunched.mp3’

pygame.init()
pygame.mixer.init()
pygame.mixer.music.load(LandingFile)

while(1) :
pygame.mixer.music.play()

#delay command should be input
while pygame.mixer.music.get_busy():
pygame.time.Clock().tick(10)

and it is my Shell Script to launch Python Script(home/ubuntu/drone/ShellScriptPractice) :

#!/bin/sh
#Linux Script for Executing Python Script.(booting)
echo “Hello World!”
python ~/DroneChallenge/AutoRun.py

I ran Shell Script with this command : sudo sh home/ubuntu/drone/ShellScriptPractice/Script.sh

and it worked well.

So I tried to add this script to startup application.

https://askubuntu.com/questions/228304/how-do-i-run-a-script-at-start-up

I followed this instruction but the all three instructions didnt work.

and I followed this :

http://elinux.org/Jetson/Performance#How_to_run_a_command_with_root_privileges_temporarily_or_on_every_bootup

but it didnt work.

I used gedit instead of Vi Editor. maybe is it problem?

(gedit:2814): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

I met this error whenever I used gedit.

I have no idea of adding simple shell script to startup application…please help me

I know nothing about the application. Does it require a GUI display? The org.freedesktop.DBus error makes me think so. You will find that there are essentially two classes of automatic startup: Those which don’t require a GUI, and those which do…you can start anything which has all prerequisite services running…many scripts can run based on the URL you mentioned, but GUI is special. Most of those methods listed as autorun occur prior to a GUI. Even if you have a GUI running, it isn’t your GUI unless you are logged in as the same user and DISPLAY is set.

So, does this require a GUI? If not a GUI, what services must be up and running before the application runs?

it does not require GUI

I have no idea why this error happens, but I solved the problem.

I inserted some shell script to .bashrc in /home.

and it worked.

Very Thank you.