WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: start up shell script  (Read 3667 times)

Offline koenh

  • WikiUser
  • *
  • Posts: 13
start up shell script
« on: August 12, 2012, 09:43:56 AM »
Hello,

I want to run a program at startup. This program is extracted in a subdirectory in my home folder. it is started by executing the a shell script.

for the moment, i need to go every time to the subdir and then "sh command.sh start"
Can i automate this?

Already thanks.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: start up shell script
« Reply #1 on: August 12, 2012, 09:56:46 AM »
If this is a non-X program that should be run as root, put it in /opt/bootlocal.sh.
http://wiki.tinycorelinux.net/wiki:bootlocal.sh_and_shutdown.sh

If this is an X program, add a startup script  in  ~/.X.d
EX:
# Start myprog
myprog &



Offline koenh

  • WikiUser
  • *
  • Posts: 13
Re: start up shell script
« Reply #2 on: August 12, 2012, 10:36:05 AM »
tx.

how do i address my .sh script in the bootlocal.sh?

gr

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6576
Re: start up shell script
« Reply #3 on: August 12, 2012, 10:41:19 AM »
Hi koenh
Add a line similiar to this:
Code: [Select]
sh /home/tc/Subdirectory/command.sh startReplace the word  Subdirectory  with the subdirectory your command is located in.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: start up shell script
« Reply #4 on: August 12, 2012, 01:11:51 PM »
That really should be packaged as an extension, not just left in /home/tc.

Offline koenh

  • WikiUser
  • *
  • Posts: 13
Re: start up shell script
« Reply #5 on: August 17, 2012, 10:54:46 PM »
ok,

i did some further search, and it should start when i put a script in the /etc/init.d
I have a script to test from the forum of the specific application. (OpenRemote)
The problem is that my /etc is not persistent.
I have once seen a command to make persistency, but i cannot find it anymore.

How can i once make all directories persitent for once?

Already thanks.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: start up shell script
« Reply #6 on: August 17, 2012, 11:23:47 PM »
Startup scripts should install to /usr/local/etc/init.d

You do not make all directories persistent.

Please spend some time in the wiki reading about persistence and backups.