LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Getting script to run at boot (https://www.linuxquestions.org/questions/linux-newbie-8/getting-script-to-run-at-boot-177756/)

Andy@DP 05-04-2004 11:10 AM

Getting script to run at boot
 
Hey people,
I have problems with my AGP port when booting normally but by typing
Code:

modprobe agpgart
when I go to init3 before logging in, it works fine.
I hate having to go to init 3 do the modprobe and then init 5. It takes too long and I keep forgetting.
I have tried to get the kernel to load the module at boot but the modprobe works and I'm happy with writing a small bash script to do this simple command.

Can I run a script at the end of the level 3 phase of the boot to do the modprobe and if so how?

TIA,
Andy.

aaa 05-04-2004 11:18 AM

See the /etc/modules.conf (for module loading on startup).

Andy@DP 05-04-2004 11:37 AM

No I tried that, it doesn't work.
Maybe I'm doing it wrong, how would I call that?
And how do you run a script before runlevel 5 kicks in?

dglnz 06-05-2004 03:53 AM

typed run a linux script at boot got from google your message and others but
info below from url http://www.redhat.com/docs/manuals/l...-run-boot.html

just might help you (or at least point you in a better direction).
dave.

below is a snippet from said url.

1.3. Running Additional Programs at Boot Time



The /etc/rc.d/rc.local script is executed by the init command at boot time or when changing runlevels. Adding commands to this script is an easy way to perform necessary tasks like starting special services or initialize devices without writing complex initialization scripts in the /etc/rc.d/init.d/ directory and creating symbolic links.



The /etc/rc.serial script is used if serial ports must be setup at boot time. This script runs setserial commands to configure the system's serial ports. See the setserial man page for more information.

sleeper.service 06-05-2004 07:39 AM

Quote:

without writing complex initialization scripts in the /etc/rc.d/init.d/ directory and creating symbolic links.
In my opinion, it shouldn't be too difficult.
The script, after all, doesn't need to be complex.

Just create your script under "/etc/init.d/".
Make sure it works when called manually.

Give it the same owner/permissions as other "init.d" scripts.
On my system, this would go like:
chown root:root myscript (skip if already root)
chmod u=rwx,g=r,o=r myscript

Finally issue "ln -s /etc/init.d/myscript /etc/rc3.d/S##myscript". Replace ## with two numbers (00...99) to control when exactly your script runs. Within the same runlevel, scripts with smaller numbers get executed before.


All times are GMT -5. The time now is 10:36 PM.