LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-28-2003, 06:32 AM   #1
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,937

Rep: Reputation: 128Reputation: 128
Where is rc.local...saving hd optimizations


I just got through using an abstract to tune my hard drive.
http://tldp.org/LDP/solrhe/Securing-...ution-v2.0.pdf
However, it was written for RH7.1 and I am using Debian. After everything has been tuned, and the beast is running like a cheeta, the last instruction is:
Once you have a set of hdparm options, you can put the commands in your /etc/rc.d/rc.local file to run it every time you reboot the machine. Yeah, right!

I can't find a rc.local in Debian.

debian:/# whereis rc.local
rc: /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d /etc/rc6.d /etc/rc.boot

And none of them has a rc.local.

rc.boot has:
debian:/etc/rc.boot# ls -al
total 4
drwxr-xr-x 2 root root 48 May 29 2002 .
drwxr-xr-x 56 root root 3560 Jul 28 18:36 ..

rc0.d and rc6.d have this:
debian:/etc/rc0.d# ls
K01xdm K14ppp K20inetd K20xfs K30setserial K89hotplug K90sysklogd S30urandom S35networking S90halt
K11cron K20exim K20makedev K25hwclock.sh K89atd K89klogd S20sendsigs S31umountnfs.sh S40umountfs

rc1.d has this:
debian:/etc/rc1.d# ls
K01xdm K11cron K14ppp K20exim K20inetd K20makedev K20xfs K89atd K89klogd K90sysklogd S11hotplug S20single

And the others (rc2.d - rc5.d) have this:
debian:/etc/rc2.d# ls
S10sysklogd S11hotplug S11klogd S14ppp S20exim S20inetd S20makedev S20xfs S89atd S89cron S99rmnologin S99xdm

So, can someone tell me how I can save these settings in Debian? My hard drive is running really well with them:

debian:/etc/rc.boot# hdparm -vtT /dev/hda

/dev/hda:
multcount = 16 (on)
I/O support = 3 (32-bit w/sync)
unmaskirq = 1 (on)
using_dma = 1 (on)
keepsettings = 1 (on)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 16 (on)
geometry = 119150/16/63, sectors = 120103200, start = 0
busstate = 1 (on)
Timing buffer-cache reads: 128 MB in 0.30 seconds =426.67 MB/sec
Timing buffered disk reads: 64 MB in 1.35 seconds = 47.41 MB/sec

TIA
 
Old 07-28-2003, 07:35 AM   #2
mrhyde
Member
 
Registered: Jul 2003
Location: Europe
Posts: 198

Rep: Reputation: 30
use your favorite editor to examine the comments in the file, eg rc.local on bsd or rh, the comments refer to how the file is used!
 
Old 07-28-2003, 07:45 AM   #3
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,937

Original Poster
Rep: Reputation: 128Reputation: 128
That post doesn't make any sense. If I don't have a rc.local file in Debian, how would I use an editor to read about it? And if I am not using bsd or rh, how or why would I find out how they use it?

Sorry if I totally misunderstood your post. Can you just explain what you mean, or where I am to examine the contents of a file which isn't on my os.

TIA
 
Old 07-28-2003, 08:50 AM   #4
mrhyde
Member
 
Registered: Jul 2003
Location: Europe
Posts: 198

Rep: Reputation: 30
I was referring to the boot.local file you mentioned, also you could create an rc.local file if you want, eg " touch /etc/rc.d/rc.local " link it to " ln -s /etc/rc.d/rc.local /etc/rc.local " and to " ln -s /etc/rc.d/rc.local /etc/init.d/rc3.d/S99rc.local " and so on, take a look at a Red Hat box and see how the file is linked!
 
Old 07-28-2003, 12:13 PM   #5
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,937

Original Poster
Rep: Reputation: 128Reputation: 128
Quote:
Originally posted by mrhyde
use your favorite editor to examine the comments in the file, eg rc.local on bsd or rh, the comments refer to how the file is used!
Now how would one examine a file which doesn't exist? One post you say examine rc.local on bsd or rh. Did you read my post carefully? I am running Debian.

The next post you say I was referring to the boot.local file you mentioned when I never mentioned a boot.local file.

The rest of your post is beyond me. Especially how you think I would take a look at a Red Hat box and see how the file is linked! While I'm at it, why don't I take a look at a Mac OS X?

I'm sorry, but your posts have gone right over my head - especially the symlink suggestion!?!?!
 
Old 07-28-2003, 01:53 PM   #6
mrhyde
Member
 
Registered: Jul 2003
Location: Europe
Posts: 198

Rep: Reputation: 30
Sorry, I meant rc.boot, my mistake. Red Hat uses SV init, at different run levels the init process starts services or programs, the last file initialized at run level 3 and level 5 is the rc.local file ( /etc/init.d/rc3.d/S99rc.local ). Traditionally BSD system administrators use this file to start extra programs they have compiled od commands they wish to run before startup is complete. Debian, like Red Hat and SuSE are BSD clones that use the SV init process to start and stop programs. I suggested looking at a Red Hat system so you could see how the rc.local file is configured. If you create the rc.local file in /etc/rc.d/ and symbolically link it to the rc directories ( run level directories ) init will execute the commands you insert in that file.
 
Old 07-28-2003, 02:40 PM   #7
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,937

Original Poster
Rep: Reputation: 128Reputation: 128
Thanks for your patience. I awoke after only a couple hours sleep and read your post. I am GMT+8:00 - it's now 3:30 a.m. Please excuse my rude reply! Btw - I'm new to Linux - my background is doze.

Debian has a file /etc/init.d/rc which has the following comments at the start of the file:

#! /bin/sh
#
# rc This file is responsible for starting/stopping
# services when the runlevel changes.
#
# Optimization feature:
# A startup script is _not_ run when the service was
# running in the previous runlevel and it wasn't stopped
# in the runlevel transition (most Debian services don't
# have K?? links in rc{1,2,3,4,5} )
#
# Author: Miquel van Smoorenburg <miquels@cistron.nl>
# Bruce Perens <Bruce@Pixar.com>
#
# Version: @(#)rc 2.78 07-Nov-1999 miquels@cistron.nl

Could this be the file where I need to put the hdparm options?

If not, please explain to me how to symlink a rc.local file that I would create. Debian doesn't have /etc/rc.d, but in /etc there is:
rc.boot
rc0.d
rc1.d
rc2.d
rc3.d
rc4.d
rc5.d
rc6.d
rcS.d

Hope I haven't missed the point entirely, or confused you with this.

TIA
 
Old 07-28-2003, 03:39 PM   #8
mrhyde
Member
 
Registered: Jul 2003
Location: Europe
Posts: 198

Rep: Reputation: 30
I'll install debian on a box now, configure the file, if all is ok I'll pass the instructions on to you, give me an hour or so.
 
Old 07-28-2003, 04:20 PM   #9
windsorjax
LQ Newbie
 
Registered: Jun 2003
Distribution: Slackware & Debian
Posts: 12

Rep: Reputation: 0
See if this helps. I think this is what you are looking for.
http://debianhelp.org/modules.php?op...rticle&sid=262
 
Old 07-28-2003, 04:52 PM   #10
mrhyde
Member
 
Registered: Jul 2003
Location: Europe
Posts: 198

Rep: Reputation: 30
Here's what I did.
Create the file. " touch /etc/init.d/rc.local " make it executable " chmod +x /etc/init.d/rc.local ". Next we make the links, " ln -s /etc/init.d/rc.local /etc/rc.local " handy link for editing! Link to run levels, level 2" ln -s /etc/init.d/rc.local /etc/rc2.d/S99local " level 3 " ln -s /etc/init.d/rc.local /etc/rc3.d/S99local " level 5 " ln -s /etc/init.d/rc.local /etc/rc5.d/S99local " to test it insert a command like " touch /home/hello.chinaman " if the file is in /home after reboot it works, remove this command, put some comments in the file just in case some one inherits the system from you ( is a work machine? ). I hope this helps you understand how the scripts are executed at different levels, it may stand by you if you install a custom package and need to write a startup script!
 
Old 07-28-2003, 11:05 PM   #11
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,937

Original Poster
Rep: Reputation: 128Reputation: 128
mrhyde,

Thank you so much! What kind of person installs an OS to *try something* for another person? If I knew how, I'd post this for everyone who visits LQ to read.

You wrote the help post so thoroughly that I copied and pasted your instructions, followed them to a t, and it all executed perfectly!

Now I will continue the process of compiling a new kernel.

That would led me into asking another question, if you please. The Securing-Optimizing-Linux-The-Ultimate-Solution-v2.0.pdf at tldp.org says,

Cleaning up the Kernel
It is important to be sure that your /usr/scr/asm and /usr/include/linux subdirectories are just symlinks to the kernel sources. Then it goes on to say to remove those two directories then rebuild new links that point to the same name directories under the new Linux kernel souce version directory.

This sounds correct to me, but I don't really know for sure if it is. Can you expound on that? I am in the process of compiling my first (monolithic) kernel for Debian, and if I totally mess it up, the worst case scenario is format and re-install. However, I'd rather not.

Thanks for your help. Wish I could repay you somehow!
 
Old 07-29-2003, 03:05 AM   #12
mrhyde
Member
 
Registered: Jul 2003
Location: Europe
Posts: 198

Rep: Reputation: 30
Hello again, well the reason I tried that little job out yesterday, I suppose curiosity, I wanted to how the init process worked on debian. This is a very interesting question you are asking! I have got to read that tldp book before I give my opinion, just to make sure I am clear on everything.
 
Old 07-29-2003, 03:18 AM   #13
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,937

Original Poster
Rep: Reputation: 128Reputation: 128
NOTE: One I posted incorrectly - it's /usr/include/asm instead of /usr/scr/asm.

Okay, thanks. From the surface it looked okay, but there's a lot of stuff in my /usr/include/asm and /usr/include/linux subdirectories. And my experience is very limited in Linux.

TIA
 
Old 07-29-2003, 04:45 AM   #14
mrhyde
Member
 
Registered: Jul 2003
Location: Europe
Posts: 198

Rep: Reputation: 30
The fastest explanation for linking these directories is; the author recommends the removal of the standard kernel, doing so will remove the original links from the /usr/src/linux directory. Building new links will ensure these #include directories are available, lets say that you remove the standard kernel, if you don't relink these directories they will not exist. If you then go to compile a new program that relies on headers from these directories you'll probably find it won't compile. ( It's possible the system won't boot either! ) I will look for a more detailed explanation of the uses of the headers in these directories and typical programs that use them, I also want to reread that document, it's very good!
 
Old 07-29-2003, 04:52 AM   #15
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,937

Original Poster
Rep: Reputation: 128Reputation: 128
Thanks. I am working on a couple of other issues right now, plus need to give some time to my family. When I can get back, I will re-read this post of yours, and read more about those headers.

I appreciate your help.

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fresh 10 install, Optimizations RedShirt SUSE / openSUSE 5 10-30-2005 11:39 AM
distro optimizations Nightfrost Linux - Distributions 12 04-19-2005 01:51 PM
Slack optimizations? bluenirve Slackware 4 09-20-2004 06:58 AM
Have any optimizations in Linux? Arc4ne Linux - General 4 06-23-2004 10:11 PM
Memory Optimizations ? tjm Linux - Software 3 07-08-2003 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration