Monday, November 25, 2019

scripts - Startup application not working after login


I have created one myscript.sh file as following


#!/bin/bash
source ~/.profile
cd $GOPATH/src
revel run test/streetcom

I need to run this file at startup after login.
I tried using startup application by creating a new field with command as the path of myscript.sh which is:


/home/pi/myscript.sh

but it did not work. I want to run the above script on the terminal after login on startup. Is there any way to run this script on tmux session. I tried adding following line after #!/bin/ bash in myscript.sh file.


tmux new -s piwork

Tmux session piwork got created but the remaining commands getting executed in another terminal window.



if you want to run the script at startup, do the following :



  1. Run sudo chmod +x /home/pi/myscript.sh to make your script executable.

  2. Open .bashrc file using sudo gedit ~/.bashrc or sudo nano ~/.bashrc

  3. Place the command that runs the script (./home/pi/myscript.sh) in the end of the file.

  4. Save and exit.


It should run on the next startup.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...