Red Hat System Administration I
Configure several services to be enabled or disabled, and started or stopped, based on a specification that is provided to you.
Outcomes
Enable, disable, start, and stop services.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start services-review
Instructions
Use the
sshcommand to log in to theserverbmachine as thestudentuser. On theserverbmachine, start thepsacctservice.Log in to the
serverbmachine as thestudentuser and switch to therootuser.[student@workstation ~]$
ssh student@serverb...output omitted... [student@serverb ~]$sudo -i[sudo] password for student:student[root@serverb ~]#Verify the status of the
psacctservice. Thepsacctservice is in an inactive and disabled state. The disabled state confirms that the service does not start at boot time.[root@serverb ~]#
systemctl status psacct○ psacct.service - Kernel process accounting Loaded: loaded (/usr/lib/systemd/system/psacct.service;disabled; vendor preset: disabled)Active: inactive (dead)Start the
psacctservice.[root@serverb ~]#
systemctl start psacctVerify that the
psacctservice is running.[root@serverb ~]#
systemctl is-active psacctactive
Configure the
psacctservice to start at system boot.Enable the
psacctservice to start at system boot.[root@serverb ~]#
systemctl enable psacctCreated symlink /etc/systemd/system/multi-user.target.wants/psacct.service → /usr/lib/systemd/system/psacct.service.Verify that the
psacctservice is enabled to start at system boot.[root@serverb ~]#
systemctl is-enabled psacctenabled
Stop the
rsyslogservice.Verify the status of the
rsyslogservice. Notice that thersyslogservice is running and enabled to start at boot time. Press q to exit the command.[root@serverb ~]#
systemctl status rsyslog● rsyslog.service - System Logging Service Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor preset:enabled)Active: active (running)since Thu 2022-05-19 04:04:43 EDT; 38min ago ...output omitted...Stop the
rsyslogservice.[root@serverb ~]#
systemctl stop rsyslogVerify that the
rsyslogservice is stopped.[root@serverb ~]#
systemctl is-active rsysloginactive
Configure the
rsyslogservice so that it does not start at system boot.Disable the
rsyslogservice so that it does not start at system boot.[root@serverb ~]#
systemctl disable rsyslogRemoved /etc/systemd/system/multi-user.target.wants/rsyslog.service.Verify that the
rsyslogservice does not start during the boot process.[root@serverb ~]#
systemctl is-enabled rsyslogdisabled
Reboot the
serverbmachine before evaluating the lab.