![]() |
Where to put the script to be evoked at booting
Hi folks,
I have following script, put on /etc/rc.d/init.d/local Code:
#!/bin/sh# ls -l /etc/rc.d/init.d/local Code:
-rwxr-xr-- 1 root root 161 Oct 1 11:34 /etc/rc.d/init.d/localHaving tried; # ln -s /etc/rc.d/init.d/local /etc/rc.d/init.d/rc5.d/ # ln -s /etc/rc.d/init.d/local /etc/rc.d/init.d/rc3.d/ # ln -s /etc/rc.d/init.d/local /etc/rc.d/init.d/ Failed. None can work. I guess it must be installed via "blfs-bootscripts-6.1" So tried as follows; # cd /sources/blfs-bootscripts-6.1 # make install-local Code:
make: *** No rule to make target `install-local'. StopCode:
make: *** No rule to make target `install-/root/local'. StopCode:
make: *** No rule to make target `install-Simple'. StopNow put the script on /root/local and start it after bootup. Because "modproble" must be evoked as "root", unable to run the script as "user" Any advice? TIA BR satimis |
set it as a suitably named service script, e.g /etc/rc.d/init.d/rc5.d/S99local
why are you trying to link it to either rc3.d or rc5.d, do you not know you own choice of runlevel? seems odd for an lfs user. |
then again the things you are trying to do should be handled elsewhere, alsa should be saving its own settings in shutdown. modules should also be being handled via /etc/modulrs.conf or equivalent.
|
Hi acid_kewpie,
Tks for your advice. Quote:
# ls -l /etc/rc.d/ Code:
total 76# ln-s /etc/rc.d/init.d/local /etc/rc.d/rc5.d/S99local What is "S99"? # ls -l /etc/rc.d/rc5.d/ Code:
total 8Quote:
BR satimis |
Hi acid_kewpie,
Quote:
http://www.linuxfromscratch.org/blfs...lsa-utils.html Quote:
# ls /etc | grep mod # ls /etc | grep mod* Both no output # find / -name modulrs.conf # find / -name modules.conf Both no output BR satimis |
> # find / -name modulrs.conf
> # find / -name modules.conf > Both no output /etc/modules.conf is used by old kernels. Insmod uses it to look up certain module-aliases and to find out which modules should be loaded at boottime. The file /etc/modprobe.conf is used by modprobe which you are probably using to load your modules into the kernel. It could well be that such a file does not exist either.(see explanation about it below) > What is "S99"? The S99Local symbolic link indicates that local should be started, that's the S as 99th item. The 99 is used to specify the order of booting in the current runlevel. So if you called S99Local S10Local it would have started before other things with a large number in the same runlevel. How do you know it didn't work? Did it give an error or did you check it? If you checked it, how? That's useful information which makes sure helping is easier. One thing still: Maybe you would like your script to be run when your system starts. Therefor create a link in rcsysinit.d like you did in rc5.d. I have one question still: Where have you read you needed tot start such a script? I have put some basic info about make and modules at the bottom. Read it if you want Good luck, Hugo Basic info about loading modules at boottime: If you have a sysfs which resides in /sys and you use udev, modrprobe will only be invoked by udev. Therefor modprobe wouldn't be used by seperate programs for loading single modules. If it would be used to load all modules separetly a file like /etc/modprobe.conf must exist to indicate which modules should be loaded at boottime. But in a LFS-system udev makes sure the proper modules are loaded automatically by looking in the /sys directory to find every device that exists on your system and afterwards it will call modrpobe to load modules. Therefor modprobe does not need to know itself which modules should be loade and there will be no need for /etc/modprobe.conf. Basic info about the make command: make looks for Makefile in the current directory and runs commands specified in it. Your make install-local doesn't work because no one has ever written how to 'install-local' in the Makefile of the bootscript-project. |
/etc/sysconfig/modules is what LFS uses to load modules.
Any particular errors on the alsa scripts? They work fine for me. |
This link might be useful: A look at System V Initialization
It should asnwer most, if not all, the questions you have about the boot script process. |
Hi kjordan,
Quote:
Code:
modprobe snd-pcm-ossThen I created /etc/modprobe.conf Code:
install snd-pcm modprobe -i snd-pcm ; modprobe snd-pcm-oss ; trueQuote:
Code:
#!/bin/sh -e$ ls -l /etc/dev.d/snd/alsa.dev Code:
-rwxr-xr-x 1 root root 703 Sep 20 07:06 /etc/dev.d/snd/alsa.devsatimis |
Hi hoes,
Tks for your advice. Quote:
Code:
Module Size Used byQuote:
# cat /etc/modprobe.conf Code:
install snd-pcm modprobe -i snd-pcm ; modprobe snd-pcm-oss ; trueQuote:
Code:
#!/bin/sh$ timidity Midi_Guitar/ Code:
Couldn't open output device# /root/local Code:
Simple mixer control 'Master',0# exit exit $ timidity Midi_Guitar/ Code:
Playing Midi_Guitar/A Casinha Pequenina_1_Brazil.midQuote:
Quote:
Others noted with tks. BR satimis |
Quote:
Tks for your link. BR satimis |
> If commenting out the lines re amixer on the script, TiMidity can play midi files but without sound.
I also have alsa on my hostsystem and encountered the same problem. Alsa is so stupid to mute every channel when the system boots. If you alsactl, you should really look in its manpage. I think it's possible to save the configuration of your mixer with that program. > #!/bin/sh > > modprobe snd-pcm-oss > modprobe snd-seq-oss > amixer set Master 80% unmute > amixer set CD 80% unmute > amixer set PCM 80% unmute > amixer set Line 80% unmute You can make LFS load a modules by putting only the name in /etc/sysconfig/modules. If you also figure out how to use alsactl to save your alsa options at shutdown and load at boottime there will be no need for your script anymore. Good luck |
[QUOTE]Originally posted by satimis
[B]Hi kjordan, I put following 2 lines on /etc/sysconfig/modules Code:
modprobe snd-pcm-ossIt doesn't need modprobe, just the name of the module. |
Hi hoes,
Quote:
If you are still encountering the problem of sound channels muted at boot while running LFS/BLFS, please try follow; Edit /etc/dev.d/snd/alsa.dev (refer to the red-color text) $ cat /etc/dev.d/snd/alsa.dev Code:
#!/bin/sh -eHTH BR satimis |
A thimbleful of background information about the startup process ...
(1) When Linux finishes basic kernel initialization, it runs one program... init. That program is the ultimate ancestor of all other processes and it never shuts down. {If it tries, you'll get a kernel panic.} (2) One of the parameters to the startup is the "runlevel," which normally is "5." This will determine exactly what init does next... that is to say, which other programs it decides to run. (3) init refers to the file /etc/inittab to find out what to do. If you examine this file, you'll see that for runlevel "n" there will be an instruction to execute the stuff in /etc/rc.d/rc.n/. (There's actually a single shell-script, named /etc/rc.d/rc, but you get the idea.) (4) To do that, init (actually rc...) takes an alphabetized listing of all the files in that directory which begin with the letter "S" (for "S"tartup). And that is why each of the files in the directory begin with "Snn", where nn is a number... to specify the alphabetic-ordering. These commands will be executed in order, given the parameter "start." (5) All of these files are usually symbolic links to command-files that will be found in /etc/init.d. (6) If you are switching from one runlevel to another, such as when you're going to/from single-user mode or shutting down or restarting, the Knn scripts are used to "K"ill the old runlevel before "S"tarting the new one. The init process is not only the startup-manager, but also the "grim reaper" that gets called when any orphaned process dies. It gets notified when power is failing and when power is restored. /etc/inittab controls all aspects of its operation. |
| All times are GMT -5. The time now is 01:44 AM. |