Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

when I type the uname -r command on linux:

uname -r 

I get the following info:

2.6.18-274.7.1.el5PAE

my question from which file uname -r read this info , or from where uname -r read the Data ?

share|improve this question
    
It comes from the running kernel. –  Michael Hampton Jan 10 '13 at 7:39
    
It uses the uname system call. linux.die.net/man/2/uname –  Kenny Rasschaert Jan 10 '13 at 7:42
    
from uname -r I get "2.6.18-274.7.1.el5PAE" is it possible to change the info so by typing uname -r I will get different info as "2.6.24-274.7.1.el5PAE" ? –  yael Jan 10 '13 at 7:45

1 Answer 1

up vote 1 down vote accepted

The files like following you can change:

[sgeorge@sgeorge-ld proc]$ ls -l /proc/sys/kernel/{hostname,domainname}
-rw-r--r-- 1 root root 0 Jan 10 00:07 /proc/sys/kernel/domainname
-rw-r--r-- 1 root root 0 Jan 10 00:07 /proc/sys/kernel/hostname

But files like following, you can't change values:

[sgeorge@SUKU proc]$ ls -l /proc/sys/kernel/{osrelease,ostype,version}
-r--r--r-- 1 root root 0 Jan 10 00:07 /proc/sys/kernel/osrelease
-r--r--r-- 1 root root 0 Jan 10 00:07 /proc/sys/kernel/ostype
-r--r--r-- 1 root root 0 Jan 10 00:07 /proc/sys/kernel/version

Demo:

[root@sgeorge-ld ~]# sudo echo "SUKU" > /proc/sys/kernel/hostname

[root@sgeorge-ld ~]# bash

[root@SUKU ~]# echo 121212 > /proc/sys/kernel/version
bash: /proc/sys/kernel/version: Permission denied

[root@SUKU ~]# echo 121212 > /proc/sys/kernel/ostype
bash: /proc/sys/kernel/ostype: Permission denied

[root@SUKU ~]# echo 121212 > /proc/sys/kernel/osrelease
bash: /proc/sys/kernel/osrelease: Permission denied

You can't modify these values.

These files can be tuned only when you build a new kernel.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.