LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-23-2003, 09:43 AM   #1
chapzilla
Member
 
Registered: May 2003
Posts: 37

Rep: Reputation: 15
Question startup configuration of shared memory


In order to install and run Oracle, I need to configure the shared memory and semaphore settings at startup. I've written a script to do it:

#!/bin/bash

echo 100 256 100 100 > /proc/sys/kernel/sem
echo 2147483648 > /proc/sys/kernel/shmmax
echo 100 > /proc/sys/kernel/shmmni
echo 2097152 > /proc/sys/kernel/shmall
echo 65536 > /proc/sys/fs/file-max
ulimit -n 65536
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
ulimit -u 16384

Unfortunately, I don't know where to put it or what to name it to make sure shared memory and the semaphores are properly configured at boot time. Can anyone suggest a solution?
 
Old 05-23-2003, 09:48 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
What distro are you using?

Jamie...
 
Old 05-23-2003, 09:50 AM   #3
chapzilla
Member
 
Registered: May 2003
Posts: 37

Original Poster
Rep: Reputation: 15
Distro Mandrake 9.1
 
Old 05-23-2003, 09:56 AM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
Uhm... not sure about Mandrake. You'll want to create a script in /etc/rc??? (it'll be something like /etc/rc3.d/SscriptName). Take a look around for the directory. I'm sure that someone will come and give you the exact path quickly enough, I'm not a Mandrake guy to can't be much more use - sorry!

HTH

Jamie...
 
Old 05-23-2003, 09:58 AM   #5
chapzilla
Member
 
Registered: May 2003
Posts: 37

Original Poster
Rep: Reputation: 15
What distro are you using? If not mandrake, what do you do in your distribution?
 
Old 05-23-2003, 10:17 AM   #6
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
I'm a Slackware guy, so I would create a new script in /etc/rc.d/ then call that from say the /etc/rc.d/rc.M so it get executed when the system goes 'Multiuser'.

cheers

Jamie...
 
Old 05-23-2003, 10:36 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
I'd use "sysctl".
Config values use dots instead of slashes and are relative to /proc/sys, so /proc/sys/kernel/sem becomes kernel.sem, and the entry looks like" kernel.sem 100 256 100 100".
As root, add the entry to a textfile, say /etc/sysctl.mem.conf*, and add a line in /etc/rc.d/rc.system "/sbin/sysctl -p /etc/sysctl.mem.conf".
*If you've got /etc/sysctl.conf, you can add it there.
 
Old 05-23-2003, 10:59 AM   #8
chapzilla
Member
 
Registered: May 2003
Posts: 37

Original Poster
Rep: Reputation: 15
I added the following to /etc/sysctl.conf and rebooted, but it didn't work:

# set shared memory parameters to satisfy Oracle requirements
kernel.shmmax 2147483648
kernel.shmmni 100
kernel.shmall 2097152
 
Old 05-23-2003, 12:27 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
What happens if you execute "/sbin/sysctl -A | grep shmmax; /sbin/sysctl -p /etc/sysctl.conf; /sbin/sysctl -A | grep shmmax"?
 
Old 05-23-2003, 01:58 PM   #10
chapzilla
Member
 
Registered: May 2003
Posts: 37

Original Poster
Rep: Reputation: 15
[root@mikesbox samba]# sysctl -A | grep shmmax
kernel.shmmax = 33554432
[root@mikesbox samba]# sysctl -p /etc/sysctl.conf
warning: /etc/sysctl.conf(31): invalid syntax, continuing...
warning: /etc/sysctl.conf(32): invalid syntax, continuing...
warning: /etc/sysctl.conf(33): invalid syntax, continuing...
 
Old 05-23-2003, 01:59 PM   #11
chapzilla
Member
 
Registered: May 2003
Posts: 37

Original Poster
Rep: Reputation: 15
I think I forgot to put the "=" in between the parameter and value

25 #net.ipv4.icmp_echo_ignore_all=1
26 net.ipv4.icmp_echo_ignore_all=1
27 net.ipv4.conf.all.log_martians=1
28 kernel.sysrq=0
29
30 # set shared memory parameters to satisfy Oracle requirements
31 kernel.shmmax 2147483648
32 kernel.shmmni 100
33 kernel.shmall 2097152
 
Old 05-23-2003, 02:05 PM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
I think I forgot to mention using the equal sign as well...
 
Old 05-23-2003, 02:08 PM   #13
chapzilla
Member
 
Registered: May 2003
Posts: 37

Original Poster
Rep: Reputation: 15
Bingo! That worked for the 3 shm parameters. I'm going to add the semaphore, file limits, etc. momentarily. What about
ulimit -n 65536
ulimit -u 16384?
 
Old 05-23-2003, 04:49 PM   #14
allo
Member
 
Registered: Jan 2003
Location: Toulouse, France
Distribution: slackware 8.1+
Posts: 35

Rep: Reputation: 15
Hello,

Perhaps, put your commands :


echo 100 256 100 100 > /proc/sys/kernel/sem
echo 2147483648 > /proc/sys/kernel/shmmax
echo 100 > /proc/sys/kernel/shmmni
echo 2097152 > /proc/sys/kernel/shmall
echo 65536 > /proc/sys/fs/file-max
ulimit -n 65536
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
ulimit -u 16384

in /etc/rc.d/rc.local - If exist in Mandrake. In slackware it's the last file before the first login after boot.

HTH
 
  


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
is shared memory expandable in memory size? Thinking Programming 4 08-16-2005 10:57 AM
c + shared memory dilberim82 Programming 3 03-07-2005 08:49 PM
shared memory blackzone Programming 1 10-14-2004 12:52 PM
About Shared Memory...? aegis_shiva Programming 1 08-25-2004 06:05 AM
shared memory socket9001 Programming 4 02-06-2004 03:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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