In this lab, you 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 ssh command to log in to the serverb machine as the student user.
On the serverb machine, start the psacct service.
Log in to the serverb machine as the student user and switch to the root user.
[student@workstation ~]$ssh student@serverb...output omitted... [student@serverb ~]$sudo -i[sudo] password for student:student[root@serverb ~]#
Verify the status of the psacct service.
The psacct service 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 psacct service.
[root@serverb ~]# systemctl start psacctVerify that the psacct service is running.
[root@serverb ~]# systemctl is-active psacct
activeConfigure the psacct service to start at system boot.
Enable the psacct service to start at system boot.
[root@serverb ~]# systemctl enable psacct
Created symlink /etc/systemd/system/multi-user.target.wants/psacct.service → /usr/lib/systemd/system/psacct.service.Verify that the psacct service is enabled to start at system boot.
[root@serverb ~]# systemctl is-enabled psacct
enabledStop the rsyslog service.
Verify the status of the rsyslog service.
Notice that the rsyslog service 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 rsyslog service.
[root@serverb ~]# systemctl stop rsyslogVerify that the rsyslog service is stopped.
[root@serverb ~]# systemctl is-active rsyslog
inactiveConfigure the rsyslog service so that it does not start at system boot.
Disable the rsyslog service so that it does not start at system boot.
[root@serverb ~]# systemctl disable rsyslog
Removed /etc/systemd/system/multi-user.target.wants/rsyslog.service.Verify that the rsyslog service does not start during the boot process.
[root@serverb ~]# systemctl is-enabled rsyslog
disabledReboot the serverb machine before evaluating the lab.
This concludes the section.