Changes

Jump to: navigation, search

OPS235 Lab 4 - CentOS7

117 bytes added, 17:43, 30 January 2016
no edit summary
<li>Note the services that are currently running.</li>
<li>Use the command <b><code><span style="color:#3366CC;font-size:1.2em;">service iptables stop</span></code></b> to stop the service named '''iptables'''</li>
<li>Run a command to verify that the '''iptables''' service has stopped.<br><br>'''NOTE:''' Although the service command seems to work, it is <u>'''deprecated'''</u> (i.e. "out-dated:). It has been replaced by using the [http://zenit.senecac.on.ca/wiki/index.php/Init_vs_systemd#systemd_Command_Usage systemctl] command. This is a command based upon a newer method of starting and managing system services called systemd (which replaces init - the "initialization table"). This method allows services to run more independently of each other, so that a service may be stopped without other dependent services to be stopped as well.<br><br>The most popular systemctl commands are shown below (can also add file extension '''.service''' is optional to include in commandthe end of the service name):<ul><li>'''systemctl list-units'''''' --all''' (get a listing of all running unitsservice names. Can pipe to grep to list service you are interested in)</li><li>'''systemctl status service-name''''''''' (Confirm status of a service - running or not-running)</li><li>'''systemctl stop service-name.service''' (stop a service)</li><li>'''systemctl start service-name.service''' (start a service)</li><li>'''systemctl restart service-name.service''' (restart a service)<br><br></li></ul></li>
<li>If you reboot now - the iptables service will be turned back on. We don't want it on though, it causes students headaches. To turn it off permanently we need to use the '''chkconfig''' command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">chkconfig iptables off</span></code></b></li>
<li>Use the '''systemctl''' command (from the link above - showing examples) to verify that the '''iptables''' service is off ('''hint:''' issue command, and pipe to grep "'''iptables'''").
13,420
edits

Navigation menu