Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[ASK] How to run a command on startup ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
tattonaga
n00b
n00b


Joined: 02 Mar 2015
Posts: 11

PostPosted: Mon Mar 02, 2015 3:36 pm    Post subject: [ASK] How to run a command on startup ? Reply with quote

i want to make run a command on startup for my gentoo, i have tried make local.start on /etc/local.d/ but the command not running on startup. pls help me, thank you.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3666

PostPosted: Mon Mar 02, 2015 3:48 pm    Post subject: Reply with quote

Are you having local in runlevel default?
Quote:
$ rc-config show
Back to top
View user's profile Send private message
tattonaga
n00b
n00b


Joined: 02 Mar 2015
Posts: 11

PostPosted: Mon Mar 02, 2015 4:00 pm    Post subject: Reply with quote

charles17 wrote:
Are you having local in runlevel default?
Quote:
$ rc-config show


Yeah that local has been started
Back to top
View user's profile Send private message
lexflex
Guru
Guru


Joined: 05 Mar 2006
Posts: 363
Location: the Netherlands

PostPosted: Mon Mar 02, 2015 4:01 pm    Post subject: Reply with quote

Also, make sure the permissions are right (does the script run from the commandline?) :

Code:
ls /etc/local.d/ -l
Back to top
View user's profile Send private message
tattonaga
n00b
n00b


Joined: 02 Mar 2015
Posts: 11

PostPosted: Mon Mar 02, 2015 6:23 pm    Post subject: Reply with quote

lexflex wrote:
Also, make sure the permissions are right (does the script run from the commandline?) :

Code:
ls /etc/local.d/ -l


is that local.start permission right ?

http://s304.photobucket.com/user/tattonaga/media/huftt_zpsdvs1zr48.png.html?filters[user]=142687532&filters[recent]=1&sort=1&o=0
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Mon Mar 02, 2015 6:33 pm    Post subject: Reply with quote

tattonaga,

From the outside that looks right.
The filename is not important as long as it ends in .start.

Does /etc/local.d/local.start work or is there atn error message?

The files here are not scripts, just lists of commands as you would enter at the keyboard.
There is no #!/bin/bash on the first line.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
tattonaga
n00b
n00b


Joined: 02 Mar 2015
Posts: 11

PostPosted: Mon Mar 02, 2015 7:09 pm    Post subject: Reply with quote

NeddySeagoon wrote:
tattonaga,

From the outside that looks right.
The filename is not important as long as it ends in .start.

Does /etc/local.d/local.start work or is there atn error message?

The files here are not scripts, just lists of commands as you would enter at the keyboard.
There is no #!/bin/bash on the first line.


there is no error message, just the local didnt work. this is my script local.start, is that wrong ?

http://s304.photobucket.com/user/tattonaga/media/huftt_zpss3tmsiny.png.html?filters[user]=142687532&filters[recent]=1&sort=1&o=0
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Mon Mar 02, 2015 7:14 pm    Post subject: Reply with quote

tattonaga,

Remove the #!/bin/sh line. This file is not a script.
Is the apachet1 part correct?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
tattonaga
n00b
n00b


Joined: 02 Mar 2015
Posts: 11

PostPosted: Mon Mar 02, 2015 7:19 pm    Post subject: Reply with quote

NeddySeagoon wrote:
tattonaga,

Remove the #!/bin/sh line. This file is not a script.
Is the apachet1 part correct?

okay, i installed manual web server. apachetl is the command to start apache2 service and aoe-discover for sharing storage from other pc.
Back to top
View user's profile Send private message
lexflex
Guru
Guru


Joined: 05 Mar 2006
Posts: 363
Location: the Netherlands

PostPosted: Mon Mar 02, 2015 7:29 pm    Post subject: Reply with quote

Shouldn't it be "apachectl " ?

( so with a "c")



What happens when you run *exactly* that command in the script from a shell ?
Back to top
View user's profile Send private message
tattonaga
n00b
n00b


Joined: 02 Mar 2015
Posts: 11

PostPosted: Mon Mar 02, 2015 7:40 pm    Post subject: Reply with quote

lexflex wrote:
Shouldn't it be "apachectl " ?

( so with a "c")



What happens when you run *exactly* that command in the script from a shell ?

you are right, the script is wrong. thanks a lot haha
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum