How to run a bash file automatically after login, and keep the terminal alive

Hello,

I have a Jetson Xavier NX running on Jetpack 4.4.1. I have created a .bash file that I must run after I login into my jetson device. The terminal window I use to run this file must remain open (otherwise, I must run it again).

In case it helps –perhaps there is an alternative way of doing this?–, the commands I have included in this bash file are:

sudo chmod a+rw /dev/ttyACM0
roslaunch turtlebot3_bringup turtlebot3_core.launch

Can someone please tell me how can I do this? Thanks :)

hello tmendozarias ,

please refer to /etc/systemd/system for all the services, they’re started after system boot-up.

Hello JerryChang,

Thank you for your prompt reply :) I’m just wondering if you could please expand a little bit on how I can create this, considering my terminal must remain open after I log in? Thank you :)

I am thinking that probably needing a chmod for a tty implies there is a much easier fix. Before you run the command, what do you see from:
ls -l /dev/ttyACM0

Does this need to be used by just one user? Or are many users sharing this one UART? The normal approach is to add the user to group “dialout”, and likely the UART is already group dialout. Then there is no need for the workaround.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.