Pages

Wednesday, May 13, 2015

centos 7 documentation.

holy shit,,, many has changed in centos version 6 to 7.

I'm shocked at first when using centos7. Many command and features have changed. when i want to restart a service, suddenly i realised there is no script at /etc/init.d/xxx

that i can do usually start stop or even restart a service.

time to learn some new manners guys... here are my documentation of centos 7. I hope it can help you.



service in centos 7

first of all centos 7 use some kind of system called systemctl  to stop, start, restart or even start the service at boot time. 


ex:    $        systemctl status sshd      ->      used for checking status of ssh service

how to restart service in centos7
system ctl output command.


when we type command above, it will show our service status. whether it active or not, can be seen on the mark above (green mark). How long the service have been up, and the white mark at the right ( enabled ) mean it will auto start at boot time. 


pretty simple right. first time i use it i really hate the way centos change the system. But after plenty time of used, im very happy with it. no more /etc/init.d/xxx restart. now become

 systemctl [start | stop | reload | restart | enable | disable ]  [service].


$        systemctl start sshd.service   ->  start service
$        systemctl status sshd  -> check status
$        systemctl stop sshd  ->  stop the service
$        systemctl enable sshd  -> automatically start at boot time
$        systemctl disable sshd -> not automatically start at boot time
$        systemctl status sshd   -> reload configuration changes


oh yeah, dont forget, command above only work as root. if you are not root then need to add sudo in front of the command.  

ex:   $ sudo systemctl start sshd.service



netstat and ifconfig

when at first i land on centos7. I also test some command like netstat, and ifconfig for changing my network. But it doesn't work at all. We need to enabled it first if we want to use the command. How to enable command pretty easy. We need to use yum command to see the packages belong to what at first.


$  yum whatprovides netstat

how to enable nestat, ifconfig centos7


from the output above we can see netstat belong to net-tools-2.0-0.17.20131004git.el7.x86_64.

gotcha,  now get it installed by tying:

$ yum install net-tools


done. Now we can use netstat and ifconfig as usual. 


This documentation is only the basic i can write for this time. I think i will write more next time if i found issues and able to solve it.  (and of course have some free time)!  Hope it helps. cheers :)



No comments:

Post a Comment