in my office, i connect to a RedHat gnu/linux m/c through telnet (actually through a software called "putty", which uses telnet as the underlying communication protocol). the initial welcome/login screen shows the following msg: Red Hat Linux release 7.2 (Enigma) ^^^ Kernel 2.4.7-10 on an i686
but the contents of "/proc/version" are: Linux version 2.4.7-10 (<some email id>) (gcc version 2.96 20000731) (Red Hat Linux 7.1 2.96-98) #<today's date> ^^^
any convincing explanation to the above weirdity, would be greatly appreciated.
also, i have a small question, which is related to the above query (actually, it might solve the above absurdity ;-) ) does the file "/proc/version" change (or is updated) at every reboot (or some other convinient time interval). i.e. if i change the entry in "/proc/version" to make it RHL 7.2, will it stay like that forever (or until someone changes it), or will it get rectified at the next reboot? also where does the display shown at login time come from?
thanks for all the help!
On Thu, Nov 06, 2003 at 10:35:42AM +0530, psawant@nse.co.in wrote:
communication protocol). the initial welcome/login screen shows the following msg: Red Hat Linux release 7.2 (Enigma) ^^^ Kernel 2.4.7-10 on an i686
This is generated from /etc/issue.net, which in turn is generated from /etc/redhat-release.
but the contents of "/proc/version" are: Linux version 2.4.7-10 (<some email id>) (gcc version 2.96 20000731) (Red Hat Linux 7.1 2.96-98) #<today's date>
Are you sure this is exactly the kind of output you get? /proc/version seems to contain information about the actual kernel you are running ... probably information about the machine on which it was built. In my case, it shows:
Linux version 2.4.20.db08 (root@trantor5) (gcc version 3.3.1 20030626 (Debian prerelease)) #1 Wed Aug 6 20:10:23 IST 2003
The kernel version says its a 2.4.20 kernel, and "db08" is an additional tag that I attached when building it, which means its a deb, created in August using the standard Debian packaging tools.
"root@trantor5" probably tells who built the kernel. But I am damn sure I didn't build it as root, but just as a normal user, so I don't know why it says root!
You'll notice that the "Debian prerelease" is actually _inside_ the the parentheses that enclose the gcc version. I am not really sure how to interpret this, but I think it just tells which distribution the compiler is from.
The "#1" probably means that this was the first kernel built from the source tree, or something like that.
The date is not _today's_ date, but the build date.
does the file "/proc/version" change (or is updated) at every reboot (or some other convinient time interval). i.e. if i change the entry in "/proc/version" to make it RHL 7.2, will it stay like that forever (or until someone changes it), or will it get rectified at the next reboot? also where does the display shown at login time come from?
/proc is not a real directory on your hard-disk. The files under /proc exist only inside the running kernel, and are used get information and also send control messages to stuff happening inside the kernel.
Sameer.
"Sameer D. Sahasrabuddhe" sameerds@it.iitb.ac.in said:
but the contents of "/proc/version" are: Linux version 2.4.7-10 (<some email id>) (gcc version 2.96 20000731)
(Red
Hat Linux 7.1 2.96-98) #<today's date>
You are prolly using the stock Redhat Kernel supplied with the install CD set, that was compiled by a Redhat developer with Redhat specific patches to the original kernel source tree on a particular machine. The email address would be that of the developer who built the kernel from some spec file s/he had made. And the machine name would be the one on which the package was built, using the last stable Redhat release(ie 7.1). AFAIK, there was this nice juicy soudnign Redhat build host called "porky"[porky.redhat.com] where lot of the package builds were done earlier.
Linux version 2.4.20.db08 (root@trantor5) (gcc version 3.3.1 20030626 (Debian prerelease)) #1 Wed Aug 6 20:10:23 IST 2003
The kernel version says its a 2.4.20 kernel, and "db08" is an additional tag that I attached when building it, which means its a deb, created in August using the standard Debian packaging tools.
"root@trantor5" probably tells who built the kernel. But I am damn sure I didn't build it as root, but just as a normal user, so I don't know why it says root!
Maybe you used Debian's kernel-pkg :)Did you use fakeroot or su-ed?
You'll notice that the "Debian prerelease" is actually _inside_ the the parentheses that enclose the gcc version. I am not really sure how to interpret this, but I think it just tells which distribution the compiler is from.
The "#1" probably means that this was the first kernel built from the source tree, or something like that.
The date is not _today's_ date, but the build date.
On Thu, Nov 06, 2003 at 06:58:02AM -0000, Sthitaprajna wrote:
"root@trantor5" probably tells who built the kernel. But I am damn sure I didn't build it as root, but just as a normal user, so I don't know why it says root!
Maybe you used Debian's kernel-pkg :)Did you use fakeroot or su-ed?
Yeah that explains it! :)
Sameer.
Sameer D. Sahasrabuddhe wrote:
/proc is not a real directory on your hard-disk. The files under /proc exist only inside the running kernel, and are used get information and also send control messages to stuff happening inside the kernel.
Slightly incorrect. There are no "files". (Obligatory matrix quote - 'Don't try to change that file. Instead, realize the truth. There is no file'). Any operation (reading/writing etc) on the /proc enteries invokes the corresponding functions in the kernelspace, and the data (the contents of the 'file') is generated on the fly, usually from the relevant data structures that are maintained inside the kernel/modules. In case of writing to the /proc files, the corresponding data structures are modified.
I *think* a module may resort to actually fiddling with a 'real' file too, but that would be usually pointless. The above is the way that the /proc filesystem renders itself most useful.
Someone correct me if I'm wrong.
--gera.