View previous topic :: View next topic |
Author |
Message |
tattonaga n00b
Joined: 02 Mar 2015 Posts: 11
|
Posted: Mon Mar 02, 2015 3:36 pm Post subject: [ASK] How to run a command on startup ? |
|
|
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 |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3666
|
Posted: Mon Mar 02, 2015 3:48 pm Post subject: |
|
|
Are you having local in runlevel default? |
|
Back to top |
|
|
tattonaga n00b
Joined: 02 Mar 2015 Posts: 11
|
Posted: Mon Mar 02, 2015 4:00 pm Post subject: |
|
|
charles17 wrote: | Are you having local in runlevel default? |
Yeah that local has been started |
|
Back to top |
|
|
lexflex Guru
Joined: 05 Mar 2006 Posts: 363 Location: the Netherlands
|
Posted: Mon Mar 02, 2015 4:01 pm Post subject: |
|
|
Also, make sure the permissions are right (does the script run from the commandline?) :
Code: | ls /etc/local.d/ -l |
|
|
Back to top |
|
|
tattonaga n00b
Joined: 02 Mar 2015 Posts: 11
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54391 Location: 56N 3W
|
Posted: Mon Mar 02, 2015 6:33 pm Post subject: |
|
|
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 |
|
|
tattonaga n00b
Joined: 02 Mar 2015 Posts: 11
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54391 Location: 56N 3W
|
Posted: Mon Mar 02, 2015 7:14 pm Post subject: |
|
|
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 |
|
|
tattonaga n00b
Joined: 02 Mar 2015 Posts: 11
|
Posted: Mon Mar 02, 2015 7:19 pm Post subject: |
|
|
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 |
|
|
lexflex Guru
Joined: 05 Mar 2006 Posts: 363 Location: the Netherlands
|
Posted: Mon Mar 02, 2015 7:29 pm Post subject: |
|
|
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 |
|
|
tattonaga n00b
Joined: 02 Mar 2015 Posts: 11
|
Posted: Mon Mar 02, 2015 7:40 pm Post subject: |
|
|
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 |
|
|
|