Given the following two symbolic links in a System V init configuration: /etc/rc1.d/K01apache2 /etc/rc2.d/S02apache2 When are the scripts executed that are referenced by these links? (Choose two.)
A.
S02apache2 is run when runlevel 2 is entered.
B.
S02apache2 is run when runlevel 2 is left.
C.
K01apache2 is never run because K indicates a deactivated service.
D.
Both S02apache2 and K01apache2 are run during a system shutdown.
A. S02apache2 is run when runlevel 2 is entered. This is because the symbolic link in /etc/rc2.d starts with the letter "S", which stands for "Start", and is followed by a number that determines the order in which the scripts are executed when entering the corresponding runlevel.
C. K01apache2 is never run because K indicates a deactivated service. This is because the symbolic link in /etc/rc1.d starts with the letter "K", which stands for "Kill", and is followed by a number that determines the order in which the scripts are executed when leaving the corresponding runlevel.
Therefore, the correct answers are A and C.
AE:
Regarding the E, we all agree that K indicates that THE SERVICE (apache2) won't take place in run level 1.
But the question (and is somewhat ambiguous wording) ask about THE SCRIPT itself that will deactivate apache2.
By following the logic of https://www.golinuxhub.com/2014/01/what-are-s-and-k-scripts-in-etc-rcxd/, the K scripts are in deed executed to stop the service.
So, if the option C didn't include the K01 and just refer to the apache2 service that would be correct. But again, the reasoning of the question refers to the script itself, or at least that is the way it is written.
The first letter of the link filename in the runlevel’s directory indicates if the service should be started or terminated for the corresponding runlevel. A link’s filename starting with letter K determines that the service will be killed when entering the runlevel (kill).
Ref: https://learning.lpi.org/en/learning-materials/101-500/101/101.3/101.3_01/
Can't say for sure, but what @Zeist said resonates more intuitively for me.
I think that K01apache2 script (Answer C) is read by the OS and is promptly killed before the service can be started / has already started.
"deactivated service" may not apply because the service could have been started prior to the scripts being executed.
I would go for A and E.
C is correct. The S stands for start and K for Kill. These are essentially links to the original scripts in /etc/rc.d. The numbers after S/K are the priority by which the services will be started/Killed
Both S and K links gives to OS instructions on how handle a specific service when an init state change happen. K and S indicate if the service will be started or stopped, the following number indicate the init level to which the script will be applied. Any link that start with K01 means that the relative service will be killed as soon as the system switch of init 1 (single user mode). A and E are correct.
I don't agree with you. The number indicates priority of execution, the init state is indicated in the folder containing the scripts. K00 will be executed first and K99 last.
On the other hand, for me A is correct. E is wrong, that script will be run when leaving runlevel 1. C might be correct, because runlevel 1 is single-user mode used for system maintenance, and in that state, services are restricted to bare-minimum, and apache might be deactivated in that runlevel.
upvoted 1 times
...
...
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Chenar
Highly Voted 2 years, 5 months agoglorofarz
Highly Voted 3 years agoZeist
2 years, 11 months agojurgen1
Most Recent 4 months agoblk_542
8 months agogonzaloco
1 year, 3 months agoserlan
1 year, 6 months agoanhcq
1 year, 8 months agoChrisGrande
1 year, 10 months agoCuriousLinuxCat
1 year, 11 months ago[Removed]
2 years, 11 months agoZeist
2 years, 11 months agoilputto
2 years, 8 months agodaca11
2 years, 7 months ago