SliTaz SliTaz Forum

You are not logged in.

#1 2016-04-07 09:03:26

Cobra
Member
Registered: 2016-04-07
Posts: 4

/etc/init.d/local.sh don't want to run my script at startup

Hello !

I'm currently using 2.6.37-slitaz for script development but I got an issue that I can't fix.

- I wrote a script which is working when I run it manually with :

"sh /usr/bin/sbin/myscript.sh"

or

"./myscript.sh"

- I want it run at every boot so I add my command

"sh /usr/sbin/myscript.sh"

into

"/etc/init.d/local.sh "

On boot the local.sh don't seems to be launched and my script has not been launched too.

I also tried manually to do "sh /etc/init.d/local.sh" then local.sh is running and my script is working but I can't find a way to properly automate it.

Do someone has an idea ?

Regards,

Gael

Offline

#2 2016-04-07 09:22:24

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: /etc/init.d/local.sh don't want to run my script at startup

Try:

$ chmod +x /etc/init.d/local.sh

Your script should start with

#!/bin/sh

Test it with:

$ /etc/init.d/local.sh

Offline

#3 2016-04-07 09:30:40

Cobra
Member
Registered: 2016-04-07
Posts: 4

Re: /etc/init.d/local.sh don't want to run my script at startup

Thanks for answer.

I already did the chmod on local.sh and my script begin with #!/bin/sh so it is good.

It works with /etc/init.d/local.sh like i did before with sh /etc/init.d/local.sh

On reboot it still doesn't run...

Offline

#4 2016-04-07 10:48:43

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: /etc/init.d/local.sh don't want to run my script at startup

RUN_SCRIPTS in /etc/rcS.conf should have local.sh, example:

$ grep RUN_SCRIPTS /etc/rcS.conf

RUN_SCRIPTS="bootopts.sh system.sh network.sh local.sh"

NB: I assume SliTaz is not running live...

Offline

#5 2016-04-07 12:12:29

Cobra
Member
Registered: 2016-04-07
Posts: 4

Re: /etc/init.d/local.sh don't want to run my script at startup

It works great now !

Thanks a lot Bellard !

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.017 seconds, 7 queries executed - Memory usage: 1.53 MiB (Peak: 1.77 MiB) ]