Tiny Core Linux

General TC => General TC Talk => Topic started by: koenh on August 12, 2012, 12:43:56 PM

Title: start up shell script
Post by: koenh 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.
Title: Re: start up shell script
Post by: gerald_clark 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 &


Title: Re: start up shell script
Post by: koenh on August 12, 2012, 01:36:05 PM
tx.

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

gr
Title: Re: start up shell script
Post by: Rich 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.
Title: Re: start up shell script
Post by: gerald_clark on August 12, 2012, 04:11:51 PM
That really should be packaged as an extension, not just left in /home/tc.
Title: Re: start up shell script
Post by: koenh 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.
Title: Re: start up shell script
Post by: gerald_clark 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.