Unix Technical Forum

sysctl.conf headaches

This is a discussion on sysctl.conf headaches within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> - OK, I've tried all the permutations I can think of, but my imagination seems to be lacking. I've ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 10:45 AM
Edd
 
Posts: n/a
Default sysctl.conf headaches

-
OK, I've tried all the permutations I can think of, but my
imagination seems to be lacking. I've added a few sysctl
settings to the /etc/sysctl.conf file, but they do not seem
to take effect on boot, only when I invoke sysctl -p by hand
as root. I also tried adding that invocation to rc.local, but
that seems to not only not work, but the rc.M script never
seems to complete. Anyone know what I am missing?
--
-Edd
++++++++++++++++++

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 10:47 AM
Menno Duursma
 
Posts: n/a
Default Re: sysctl.conf headaches

On Sun, 18 Apr 2004 15:44:34 +0000, Edd wrote:

> OK, I've tried all the permutations I can think of, but my
> imagination seems to be lacking. I've added a few sysctl
> settings to the /etc/sysctl.conf file, but they do not seem
> to take effect on boot, only when I invoke sysctl -p by hand
> as root.


That is odd.
Have you tried creating a little test script?

> I also tried adding that invocation to rc.local, but
> that seems to not only not work,


Well, what exectly did you add?

> but the rc.M script never seems to complete.


Try changeing the shebang line to:

#!/bin/bash -vx

And running it from the command-line, ie:

/etc/rc.d/rc.local

> Anyone know what I am missing?


Nope. As you don't give enough info ...
I would test if it should work before executing though, like:

if [ -r /etc/sysctl.conf -a -x /sbin/sysctl ]; then
echo "Setting some kernel parameters: /sbin/sysctl -p /etc/sysctl.conf"
/sbin/sysctl -p /etc/sysctl.conf > /dev/null
fi

--
-Menno.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 10:48 AM
Edd
 
Posts: n/a
Default Re: sysctl.conf headaches

Menno Duursma wrote:
> On Sun, 18 Apr 2004 15:44:34 +0000, Edd wrote:
>
>
>> OK, I've tried all the permutations I can think of, but my
>>imagination seems to be lacking. I've added a few sysctl
>>settings to the /etc/sysctl.conf file, but they do not seem
>>to take effect on boot, only when I invoke sysctl -p by hand
>>as root.

>
>
> That is odd.
> Have you tried creating a little test script?
>
>
>>I also tried adding that invocation to rc.local, but
>>that seems to not only not work,

>
>
> Well, what exectly did you add?
>
>
>>but the rc.M script never seems to complete.

>
>
> Try changeing the shebang line to:
>
> #!/bin/bash -vx
>
> And running it from the command-line, ie:
>
> /etc/rc.d/rc.local
>
>
>>Anyone know what I am missing?

>
>
> Nope. As you don't give enough info ...
> I would test if it should work before executing though, like:
>
> if [ -r /etc/sysctl.conf -a -x /sbin/sysctl ]; then
> echo "Setting some kernel parameters: /sbin/sysctl -p /etc/sysctl.conf"
> /sbin/sysctl -p /etc/sysctl.conf > /dev/null
> fi
>

-
I added

if [ -x /etc/sysctl.conf ]; then
echo "Setting sysctl.conf parms"
. /sbin/sysctl -p /etc/sysctl.conf
fi

to the rc.local file. ( #!/bin/sh on the first line )
--
-Edd
++++++++++++++++++

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 10:48 AM
Edd
 
Posts: n/a
Default Re: sysctl.conf headaches

Edd wrote:

> Menno Duursma wrote:
>
>> On Sun, 18 Apr 2004 15:44:34 +0000, Edd wrote:
>>
>>
>>> OK, I've tried all the permutations I can think of, but my
>>> imagination seems to be lacking. I've added a few sysctl
>>> settings to the /etc/sysctl.conf file, but they do not seem
>>> to take effect on boot, only when I invoke sysctl -p by hand
>>> as root.

>>
>>
>>
>> That is odd.
>> Have you tried creating a little test script?
>>
>>
>>> I also tried adding that invocation to rc.local, but
>>> that seems to not only not work,

>>
>>
>>
>> Well, what exectly did you add?
>>
>>
>>> but the rc.M script never seems to complete.

>>
>>
>>
>> Try changeing the shebang line to:
>>
>> #!/bin/bash -vx
>>
>> And running it from the command-line, ie:
>>
>> /etc/rc.d/rc.local
>>
>>
>>> Anyone know what I am missing?

>>
>>
>>
>> Nope. As you don't give enough info ...
>> I would test if it should work before executing though, like:
>>
>> if [ -r /etc/sysctl.conf -a -x /sbin/sysctl ]; then
>> echo "Setting some kernel parameters: /sbin/sysctl -p
>> /etc/sysctl.conf"
>> /sbin/sysctl -p /etc/sysctl.conf > /dev/null
>> fi
>>

> -
> I added
>
> if [ -x /etc/sysctl.conf ]; then
> echo "Setting sysctl.conf parms"
> . /sbin/sysctl -p /etc/sysctl.conf
> fi
>
> to the rc.local file. ( #!/bin/sh on the first line )


Well, I wish I had thought before clicking submit...

Try...



#!/bin/sh

if [ -r /etc/sysctl.conf ]; then
echo "Setting sysctl.conf parms"
. /sbin/sysctl -p /etc/sysctl.conf
fi


#end of rc.local

--
-Edd
++++++++++++++++++

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 10:48 AM
zebul666
 
Posts: n/a
Default Re: sysctl.conf headaches

Edd wrote:
> . /sbin/sysctl -p /etc/sysctl.conf


Why is there a dot before /sbin/sysctl ??? Remove it.
You don't need to source sysctl as it is not a shell script but
an elf binary !!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-19-2008, 10:53 AM
Edd
 
Posts: n/a
Default Re: sysctl.conf headaches

zebul666 wrote:
> Edd wrote:
>
>> . /sbin/sysctl -p /etc/sysctl.conf

>
>
> Why is there a dot before /sbin/sysctl ??? Remove it.
> You don't need to source sysctl as it is not a shell script but
> an elf binary !!

-
That did the trick. Thanks. The dangers of copy-n-paste...
--
-Edd
++++++++++++++++++

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:38 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com