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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| - 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 ++++++++++++++++++ |
| |||
| 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. |
| |||
| 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 ++++++++++++++++++ |
| |||
| 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 ++++++++++++++++++ |
| ||||
| 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 ++++++++++++++++++ |