One of the standard and long accepted procedures of the armed forces in the chain of command is succession.
10 U.S. Code § 162 - Combatant commands: assigned forces; chain of command
U.S. Code › Title 10 › Subtitle A › Part I › Chapter 6 › § 162
https://www.law.cornell.edu/uscode/text/10/162
The laws of the United States pertaining to the chain of command apply to any officer who is second in command, such as a deputy commanding officer etc:
Chapter 10
PRECEDENCE, AUTHORITY AND COMMAND
Section 1. Precedence
Section 2. Authority
Section 3. Detail to Duty
Section 4. Succession to Command
1004. Precedence of an Officer in
Command.
An officer, either of the line or of a staff corps,
detailed to command by competent authority or
who has succeeded to command, has precedence
over all officers or other persons attached to the
command of whatever rank and whether they
are of the line or of a staff corps.
1061. Detail of Executive Officer.
1. The officer detailed as executive officer shall
be an officer eligible to succeed to command who,
when practicable, is next in rank to the
commanding officer.
2. When no officer has been detailed as
executive officer by the Commandant of the
Marine Corps or the Chief of Naval Personnel,
as appropriate, or when the officer so detailed is
absent or incapable of performing the duties of
the office, the commanding officer shall detail
the senior line officer within the command and
eligible to succeed to command as executive
officer except that, if the commanding officer is a
member of a staff corps, he or she may detail as
executive officer the next senior officer in the
appropriate staff corps.
https://doni.documentservices.dla.m...er 10 - Precedence, Authority and Command.pdf
Your Navy
Three-star heads to 5th Fleet after admiral’s sudden death
Vice Adm. James Malloy has been named the interim head of the Navy's 5th Fleet in the Middle East following the sudden death of Vice Adm. Scott Stearney this weekend. Malloy is shown here in 2016 when he commanded Carrier Strike Group 10. (Navy)
A three-star admiral will aid U.S. Navy forces in the Middle East following the sudden death of Vice Adm. Scott Stearney in Bahrain.
Vice Adm. James Malloy will serve in a temporary support role for 5th Fleet and Naval Forces Central Command, Navy spokesman Cmdr. Jereal Dorsey said Monday.
Navy officials initially characterized Malloy’s temporary duty in 5th Fleet as that of an interim commander, but later said he would serve in a supporting role.
Stearney, 58, was found dead in his Bahrain residence Saturday but foul play is not suspected, according to a social media message posted that day by Chief of Naval Operations Adm. John Richardson.
Rear Adm. Paul Schlise, Stearney’s immediate deputy, remains acting commander of a crucial command that sprawls across 2.5 million square miles of water, including the Persian Gulf and the Strait of Hormuz.
https://www.navytimes.com/news/your...ander-named-after-vice-admirals-sudden-death/