Which file should be modified to make configuration changes across reboots?

The change that are made by using echo command, like the one shown in the example below, are
not persistent and disappear when the system us restarted. Which file should be modified to make
configuration changes across reboots?
# echo www.example.com > /proc/sys/kernel/hostname

The change that are made by using echo command, like the one shown in the example below, are
not persistent and disappear when the system us restarted. Which file should be modified to make
configuration changes across reboots?
# echo www.example.com > /proc/sys/kernel/hostname

A.
/etc/sys/sysct1.conf

B.
/etc/sysconfig.conf

C.
/etc/sysct1.conf

D.
/proc/sysct1.conf

Explanation:
A configuration file exists for the purpose of persisting changes,
named/etc/sysct1.conf. When booting, your server starts the procps service that reads this
configuration file and applies all settings in it.
Note:
*If you’ve ever needed to change the hostname for Red Hat Linux, CentOS or similar operating
systems, you can do so easily with one simple command.
Just use the echo command to replace the contents of /proc/sys/kernel/hostname with your new
host name.
# echo hostname.com > /proc/sys/kernel/hostname
Then restart the network interfaces:
# /etc/init.d/network restart
Shutting down interface venet0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface venet0: RTNETLINK answers: File exists
RTNETLINK answers: File exists
[ OK ]
Now you can use the hostname command to verify that it has changed.



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Matt

Matt

/etc doesn’t have a sys subdirectory. The first line of the explanation says “A configuration file exists for the purpose of persisting changes, named /etc/sysctl.conf.” The answer is C

nwildner

nwildner

C is the correct but there is a typo. It’s sysctl.conf not sysct1.conf

david

david

Correct answer is C

Naga

Naga

Answer is C : /etc/sysctl.conf