How to set up a customized target on CENTOS
You have been handed a server that needs to be customized according to a specific standard. complete the following objectives?
OBJECTIVES
1. carry out a checklist on the default target in order to make sure the custom target you will create works.
2. Your custom target should be identical to your default target. Except that it should want httpd service.
Experience level
Basic
1. verify default target
2. CREATE custom.target
a) Change directory: cd/etc/systemd/system
b) create a file by copying multi-user.target into custom.target: /usr/lib/systemd/system/multi-user.target ./custom.target
c) open the file: nano custom.target
d) Edit the [unit] section:
?????[Unit]
?????Description=Custom Target
?????Documentation=man:systemd.special(7)
?????Requires=basic.target
?????Wants=httpd.service
?????Conflicts=rescue.service rescue.target
?????After=basic.target rescue.service rescue.target
?????AllowIsolate=yes
e) use the __ctrl X__ option to save and quit
??check if httpd is already installed in the server: rpm -q httpd
??if not installed, do yum install httpd -y
f) isolate custom.target
g) check status of httpd: systemctl status httpd
If we try to isolate into multi-user.target, we will see that httpd is dead because it is not set up to want Apache service.