Dear all,
I would like to run the jetson-inference container when my jetson nano is started(on boot).
So, I created a bash shell script which contains:
gnome-terminal --window -t "jetson session" --working-directory="/home/$username/jetson-inference" -- bash -c '{ echo "Session started successfully..." || echo "Session failed to start.See log file.";docker/run.sh -v /root/scripts:/custom_scripts > '${log_custom_scripts}' ;} '
where
log_custom_scripts = "log_custom_scripts.txt"
username = localuser
Then, I created myservice.service as following:
[Unit]
Description=Execute this on boot
After=multi-user.target
[Service]
Environment=XAUTHORITY=/home/localuser/.Xauthority # Get the stored credentials of localuser to be authenticated
Environment=DISPLAY=:0 # This needs to enable GUI X session, right?
ExecStartPre=/bin/sleep 20 # Delay it just in case
ExecStart=/root/scripts/myscript.sh
[Install]
WantedBy=multi-user.target
and I put it into the /etc/systemd/system.
I tested the service before enabling to start on boot:
sudo systemctl start myservice.service
and get the status in another terminal by
sudo systemctl status myservice.service
Unfortunately, I received:
the input device is not a TTY
I tried to start the container without the gnome-terminal but without success. More specific,
execute it in background
cd /home/$username/jetson-inference
docker/run.sh -v /root/scripts:/custom_scripts > $log_custom_scripts &
or in foreground
cd /home/$username/jetson-inference
docker/run.sh -v /root/scripts:/custom_scripts > $log_custom_scripts
I also tried
startx docker/run.sh -v /root/scripts:/custom_scripts > $log_custom_scripts
but I received
(==) Log file: "/var/log/Xorg.1.log", Time: Thu Apr 18 14:47:05 2024
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
/usr/bin/xterm: No absolute path found for shell: docker/run.sh
xinit: connection to X server lost
waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.
For your information, I have followed these forum discussions:
I understand that jeston-inference container needs a GUI X session.
Is it possible to start the container in a GUI session?
I would really appreciate any help.
Regards,