LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-05-2008, 10:16 AM   #1
ibaniski
LQ Newbie
 
Registered: Nov 2008
Posts: 10

Rep: Reputation: 0
add custom sysctl key


Hi.

I am writing a module, and I need an easy way to set parameters to it. Using sysctl seems to be an easy and convenient way of doing ti. The only problem: I can't do it .

Say I want to add a length parameter to /proc/sys/net/mymod/length of value 10. When I execute
PHP Code:
sysctl -w net.mymod.length=10 
I get the following error "net.mymod.length is an unknown key".

So my question is whether it is at all possible to use sysctl to set certain parameters for my module? If so, what do I have to do to create a custom key? If not, what would be a good alternative?

Thanks,
i.b.
 
Old 11-09-2008, 04:24 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by ibaniski View Post
possible to use sysctl to set certain parameters for my module? If so, what do I have to do to create a custom key?
Basically just research. With that I mean that if you take one known sysctl key, say DEV_SCSI_LOGGING_LEVEL and follow where it gets referenced in the kernel you should get the idea. It's not like there's no LKM's that use sysctl to accept values. First external one comes to mind that introduces its own sysctl values is the Wireless Tools but there's hundreds you could take as example.
 
  


Reply

Tags
key, sysctl, unknown



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
add custom sysctl key ibaniski Linux - Software 1 11-06-2008 02:53 AM
Add a custom-built rpm to a repository neildomo Red Hat 6 10-15-2008 09:11 PM
SAX2 - How to add a custom modeline? mr_r SUSE / openSUSE 2 07-13-2006 07:03 AM
How can I add custom data to my executable bestofmed Programming 3 07-29-2004 03:24 AM
sysctl permissions error on key vm.freepages DavidPhillips Linux - General 2 06-16-2001 10:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:58 PM.

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
Open Source Consulting | Domain Registration