WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline koenh

  • Newbie
  • *
  • Posts: 13
start up shell script
« on: August 12, 2012, 12:43:56 PM »
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, 12:56:46 PM »
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

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

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

gr

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: start up shell script
« Reply #3 on: August 12, 2012, 01:41:19 PM »
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, 04:11:51 PM »
That really should be packaged as an extension, not just left in /home/tc.

Offline koenh

  • Newbie
  • *
  • Posts: 13
Re: start up shell script
« Reply #5 on: August 18, 2012, 01:54:46 AM »
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 18, 2012, 02:23:47 AM »
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.