Open main menu

CDOT Wiki β

Changes

OPS235 Lab 4 - CentOS7

296 bytes added, 16:50, 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''' to the end of the service name):<ul><li>'''systemctl list-units --all''' (get a listing of all service 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''' (stop a service)</li><li>'''systemctl start service-name''' (start a service)</li><li>'''systemctl restart service-name''' (restart a service)</li><li>'''systemctl enable service-name''' (enable service so service runs upon system startup)</li><li>'''systemctl disable service-name''' (disable service so it does NOT run upon system startup)<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 '''chkconfigsystemctl''' command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">chkconfig systemctl disable iptables off</span></code></b>(the chkconfig command used to be the way to enble/disable services, but is now deprecated).</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'''").
<li>Reboot and confirm that it's no longer running.</li>
13,420
edits