-3

I have the following shell script code that is not running at boot time.

The boot.sh file is located in /home/icrs/boot.sh:

#!/bin/bash
cd /home/icrs/manipulator_proj
source devel/setup.bash 
xterm -hold -e "roscore" &
//xterm -hold -e "cd ~/manipulator_proj/ && ls && catkin_make"  
//xterm -hold -e "cd ~/manipulator_proj/ && source devel/setup.bash"
xterm -hold -e "cd ~/manipulator_proj/ && rosrun dynamixel_control  dynamixel_control"
xterm -hold -e "cd ~/manipulator_proj/ && rosrun dynamixel_control ik"
xterm -hold -e "cd ~/manipulator_proj/ && rosrun dynamixel_control server_node"

In terminal it's running fine and excuting, but at boot time it's not running. I placed this file in /etc/rc.local:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/home/icrs/boot.sh:
exit 0

Kindly suggest us any solution for this issue.

dessert
  • 39,982
  • 3
    Your script runs graphical programs, so I suppose you want it to be rather started on login – see the linked question for how to do that. – dessert Feb 02 '18 at 07:27

1 Answers1

3

Seems your script should run when you log in to X. Have a look under System > Preferences > Startup Applications.

Alternatively you can press Alt+F2 and run the gnome-session-properties command. Add your script here.

dessert
  • 39,982
LeonidMew
  • 2,734
  • 1
  • 21
  • 38