View previous topic :: View next topic |
Author |
Message |
maw Apprentice
Joined: 25 Aug 2002 Posts: 175 Location: Nottingham, UK
|
Posted: Wed Sep 18, 2002 10:02 am Post subject: Where to put hdparm commands in startup? |
|
|
Sorry if this has been asked before, I couldn't find it when I searched (not very good at searching, admittedly).
Where do I put hdparm commands so that Gentoo executes them on startup? I tried putting them in local.start, and they appear to execute correctly, but the weird thing is that once GDM's started up and I've logged in, the hard drives and DVD drives have reset themselves and it's as if hdparm was never run. If I then run it after logging in as root, it works fine.
So where do I put them to avoid this? Or is this a weird thing with my system that shouldn't be happening?
Thanks _________________ Your Gentoo woll sle me sodenly!
I may the beaute of it not sustene
(to misquote Chaucer) |
|
Back to top |
|
|
arkane l33t
Joined: 30 Apr 2002 Posts: 918 Location: Phoenix, AZ
|
Posted: Wed Sep 18, 2002 3:50 pm Post subject: |
|
|
I put my hdparm parameters into the /etc/conf.d/local.start file. (the file for miscellaneous entries) Since your putting them in there, well... hmm.. maybe there is some other program overriding it? Not sure!
I don't run GDM or KDM anymore.. never had the problem back when I ran KDM. |
|
Back to top |
|
|
Malakin Veteran
Joined: 14 Apr 2002 Posts: 1692 Location: Victoria BC Canada
|
Posted: Thu Sep 19, 2002 2:32 am Post subject: |
|
|
If you setup your kernel well you shouldn't need to do this.
"use pci dma by default when available" is probably what you're missing. |
|
Back to top |
|
|
dizzy n00b
Joined: 04 Aug 2002 Posts: 50 Location: Melb.OZ.Terra.Sol
|
Posted: Thu Sep 19, 2002 2:47 am Post subject: |
|
|
maw: Another place you could look at is /etc/init.d/hdparm. Use rc-update and add it to boot runlevel should do what you want. |
|
Back to top |
|
|
maw Apprentice
Joined: 25 Aug 2002 Posts: 175 Location: Nottingham, UK
|
Posted: Thu Sep 19, 2002 8:20 am Post subject: |
|
|
Thanks.
I've got that kernel option turned on, by the way, and it never does anything. That's across two different motherboards in recent memory, so unless it's disagreeing with VIA IDE controllers I'm baffled by that. Oh well. I'll have a look at /etc/init.d/hdparm _________________ Your Gentoo woll sle me sodenly!
I may the beaute of it not sustene
(to misquote Chaucer) |
|
Back to top |
|
|
de4d Apprentice
Joined: 12 Sep 2002 Posts: 181 Location: fr. i. br. (ger)
|
Posted: Thu Sep 19, 2002 8:29 am Post subject: |
|
|
arkane wrote: | I put my hdparm parameters into the /etc/conf.d/local.start file. (the file for miscellaneous entries)
|
i think this is the wrong place cuz this file is xecuted after the boot process (which is then slow)
to optimize imho this is the right version:
dizzy wrote: | Another place you could look at is /etc/init.d/hdparm. Use rc-update and add it to boot runlevel should do what you want. |
best way offcourse is setting the right kernel options... _________________ void main(){fork();main();} |
|
Back to top |
|
|
maw Apprentice
Joined: 25 Aug 2002 Posts: 175 Location: Nottingham, UK
|
Posted: Fri Sep 20, 2002 7:32 pm Post subject: |
|
|
As I've mentioned, the kernel options for DMA don't seem to do anything on my system. I don't know why. Besides, my boot process is fast enough for me. Very fast, actually.
I added hdparm to my default runlevel, now everything seems fine. Thanks. _________________ Your Gentoo woll sle me sodenly!
I may the beaute of it not sustene
(to misquote Chaucer) |
|
Back to top |
|
|
iKiddo Guru
Joined: 27 Jun 2002 Posts: 341 Location: Europe?
|
Posted: Sat Sep 21, 2002 8:52 am Post subject: |
|
|
Hi, after having discovered the wonders of rc-update (read: made my own rc-update script ) I tried the hdparm thingy. I edited the file to my likings and then updated rc. But while booting up I got an error, I didn't have the permission to hdparm the odd thing is, I thought the boot-up procedure was executed under root privileges ?? Why doesn't this work for me ??
Any help appreciated,
ikiddo |
|
Back to top |
|
|
simon Apprentice
Joined: 26 Apr 2002 Posts: 225 Location: Vienna
|
Posted: Sat Sep 21, 2002 12:13 pm Post subject: |
|
|
Hi,
because hdparm is
Code: | -rw-r--r-- 1 root root 387 Aug 25 18:09 /etc/init.d/hdparm |
on your system?
Change the permissions to be executable.
Code: | # chmod 755 /etc/init.d/hdparm
# ls -al /etc/init.d/hdparm
-rwxr-xr-x 1 root root 387 Aug 25 18:09 hdparm
|
I always test the scripts (start/stop) bevor adding it to any runlevel.
Simon |
|
Back to top |
|
|
ViceClown n00b
Joined: 10 May 2002 Posts: 54 Location: Philadelphia, PA, USA
|
Posted: Sat Sep 21, 2002 12:59 pm Post subject: Same problem |
|
|
This is a great thread and Im having the same permission problems when trying to execute my hdparm init script:
#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /home/cvsroot/gentoo-x86/sys-apps/hdparm/files/hdparm-init,v 1.1 2002/08/15 20:13:52 azarah Exp $
depend() {
need localmount
}
start() {
ebegin "Enabling DMA on IDE drives"
/sbin/hdparm -d1 /dev/hd/*u? &> /dev/null
eend
}
When I try to run it I get a :
"bash: /etc/init.d/hdparm: /sbin/runscript: bad interpreter: Permission denied" error.
Im a pretty novice scripter so Im a bit lost here. Any suggestions? |
|
Back to top |
|
|
ViceClown n00b
Joined: 10 May 2002 Posts: 54 Location: Philadelphia, PA, USA
|
Posted: Sat Sep 21, 2002 1:01 pm Post subject: |
|
|
Wups... got it. It WAS a permissioning thing but on the script itelf - i thought it was the hdparm command. Sweet!! |
|
Back to top |
|
|
iKiddo Guru
Joined: 27 Jun 2002 Posts: 341 Location: Europe?
|
Posted: Sat Sep 21, 2002 3:01 pm Post subject: |
|
|
ViceClown wrote: | Wups... got it. It WAS a permissioning thing but on the script itelf - i thought it was the hdparm command. Sweet!! |
same here ! problem solved !
Now for something completely different: (wel....) in the script you can use "use", "need" and "provide" within the depend() function, but what do they mean?? I understand need, and I think use is self explanatory enough, but provide?? In the metalog scipt it says "provide logger", what does it mean?? |
|
Back to top |
|
|
rojaro l33t
Joined: 06 May 2002 Posts: 732
|
Posted: Sat Sep 21, 2002 5:21 pm Post subject: |
|
|
why not simply place the command into /etc/conf.d/local.start ... thats imho the correct place to do such stuff _________________ A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970) |
|
Back to top |
|
|
simon Apprentice
Joined: 26 Apr 2002 Posts: 225 Location: Vienna
|
Posted: Sat Sep 21, 2002 8:13 pm Post subject: |
|
|
I know, it is described this way in the installation guide, but for what purpose is /etc/init.d/hdparm ?
Simon |
|
Back to top |
|
|
rojaro l33t
Joined: 06 May 2002 Posts: 732
|
Posted: Sat Sep 21, 2002 9:09 pm Post subject: |
|
|
well, i'd say someone got lazy enough to create a init script, but as there are so many diffrent configurations/combinations of controllers and harddrives possible and as you can really damage your harddrives physically using an unthought hdparm setting, i think it's a bad idea to provide such a script (but thats probably the reason why it isnt executable by default). _________________ A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970) |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Sat Sep 21, 2002 9:20 pm Post subject: |
|
|
Actually, having the hdparm script is correct. It just needs some work in order to gets its config parameters from /etc/conf.d like other init scripts. It is a straight-forward modification though. The state it is in right now will work for many (most?) users anyway. |
|
Back to top |
|
|
|