LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-09-2006, 12:52 AM   #1
gauri
Member
 
Registered: Dec 2005
Posts: 31

Rep: Reputation: 15
new bie questions


Hi all,

I am a new bie and learning linux step by step. I am googling a lot but still unabel to find few things like below:

1. how to clean ipcs if I reboot the system it is cleaned but can I do that with out rebooting the system
2. I donít have any in side the folder /usr/src and one of my auto script is expecting the following file
/usr/src/linux-2.6.10


Could any one can help me.

Thanks & Regards
Gauri
 
Old 02-09-2006, 02:48 AM   #2
kloss
Member
 
Registered: Nov 2004
Location: France & Germany
Distribution: (Pure) Debian Etch & Sid
Posts: 116

Rep: Reputation: 15
1. ?
2. I think you should install the kernel headers.

++
 
Old 02-09-2006, 05:24 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
1. Use ipcrm:

Code:
 #!/bin/csh -f
#system cleanup for LINUX
foreach i (`ipcs -m | tail +4 | awk '{print $2}'`)
    ipcrm shm $i
end
foreach i (`ipcs -s | tail +4 | awk '{print $2}'`)
    ipcrm sem $i
end
2. ?

 
Old 02-14-2006, 06:13 AM   #4
gauri
Member
 
Registered: Dec 2005
Posts: 31

Original Poster
Rep: Reputation: 15
Hi,

Can you please expalin me this script.

Thanks & Regards
Gauri
Quote:
Originally Posted by nx5000
1. Use ipcrm:

Code:
 #!/bin/csh -f
#system cleanup for LINUX
foreach i (`ipcs -m | tail +4 | awk '{print $2}'`)
    ipcrm shm $i
end
foreach i (`ipcs -s | tail +4 | awk '{print $2}'`)
    ipcrm sem $i
end
2. ?

 
Old 02-14-2006, 09:11 AM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Sure

Step by step:
Code:
ipcs -m
Gives a human friendly list of shared memory on your system:
gives this on my box at the moment:
Quote:
user@debian:/xfs/tool/own$ ipcs -m

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 57573377 user 600 196608 2 dest
0x00000000 57606146 user 600 393216 2 dest
0x00000000 75694083 user 600 393216 2 dest
0x00000000 75726852 user 600 196608 2 dest
First we need to remove the first empty lines and the header (Shared Memory Segments, key shmid owner,..)
Code:
ipcs -m | tail +4
This gives :
Quote:
0x00000000 57573377 user 600 196608 2 dest
0x00000000 57606146 user 600 393216 2 dest
0x00000000 75694083 user 600 393216 2 dest
0x00000000 75726852 user 600 196608 2 dest
Then we know that to remove an ipcs we can use ipcrm but that this program wants to ipcs id as argument. So we have to extract column 2:

Code:
ipcs -m | tail +4 | awk '{print $2}'
This gives :
Quote:
57573377
57606146
75694083
75726852
And then we make a loop on these id and we pass it to ipcrm.
ipcrm shm $i for shared memory.

The same for semaphores and messages.
 
Old 02-15-2006, 01:04 AM   #6
gauri
Member
 
Registered: Dec 2005
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks a lot. I was not getting what this tail is doing here actually.

Thanks for replying for such small doubt.

Regards
Gauri
Quote:
Originally Posted by nx5000
Sure

Step by step:
Code:
ipcs -m
Gives a human friendly list of shared memory on your system:
gives this on my box at the moment:


First we need to remove the first empty lines and the header (Shared Memory Segments, key shmid owner,..)
Code:
ipcs -m | tail +4
This gives :

Then we know that to remove an ipcs we can use ipcrm but that this program wants to ipcs id as argument. So we have to extract column 2:

Code:
ipcs -m | tail +4 | awk '{print $2}'
This gives :


And then we make a loop on these id and we pass it to ipcrm.
ipcrm shm $i for shared memory.

The same for semaphores and messages.
 
  


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
New bie sajigeorge LinuxQuestions.org Member Intro 2 01-27-2006 03:19 PM
New Bie Indian_bee LinuxQuestions.org Member Intro 1 06-16-2004 05:48 AM
new bie to mysql varala_kanth Linux - Software 5 05-06-2004 07:13 AM
hi new bie here ksd Slackware 5 09-22-2003 07:49 AM
help a new bie howhao Linux - Software 6 11-25-2001 04:31 AM

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

All times are GMT -5. The time now is 09:34 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