David's final instructions before he died
When David knew that he was about to die, he gave these final instructions to his son Solomon:
“I am about to die [EUP], like everyone else on earth does. Be courageous and conduct yourself as an adult should. Do what Yahweh our God tells you to do. Conduct yourself as he wants you to do. Obey all of his laws and commands and precepts and instructions that are written in the laws that Moses gave us. Do this in order that you will prosper in all that you do and wherever you go. If you continually do that, Yahweh will do what he promised me: He said, ‘If your descendants do what I tell them to do, and faithfully obey my commands with all their inner beings, they will always be [LIT] the ones who will rule [MTY] Israel.’
There is something else that I want you to do. You know what Joab did to me. He killed my two army commanders, Abner and Amasa. He murdered them violently [MTY] during a time of peace, pretending that it was a time of war. Those two men ◄were innocent/had not done what was wrong►. But he caused their blood to stain his belt and his sandals. Because you are wise, do to him what you think is best for you to do, but do not allow him to become old [MTY] and then die [IDI] peacefully.
But act kindly toward the sons of Barzillai, the man from the Gilead region, and be sure that they always have enough food to eat [MTY]. Do that because Barzillai helped me when I was running away from your older brother Absalom.
Also, you remember Gera's son Shimei from Bahurim town in the area where the descendants of Benjamin live. You know what he did to me. He cursed me terribly on the day I left Jerusalem and went to Mahanaim town. But when he later came down to see me at the Jordan River, I solemnly promised, while Yahweh listened [MTY], that I would not cause him to be executed. But now you must [LIT] surely punish him. You are a wise man, so you will know what you should do to him. He is an old man [MTY], but be sure that he loses/sheds a lot of blood when you kill him [MTY].”
10 Then David died [EUP] and was buried in that part of Jerusalem which was called ❛The City of David❜. 11 David had been the king of Israel for 40 years: He ruled for seven years in Hebron and for 33 years in Jerusalem. 12 Solomon became the ruler/king [MTY] to take the place of his father David and took control of all of the kingdom.
Solomon had Adonijah killed
13  One day Adonijah came to Solomon's mother Bathsheba. She said to him, “Have you come because you want things to go well?” He replied, “Yes.”
14 But then he said, “I have something to request you to do.” She said, “Tell me what you want me to do.”
15 He said, “You know that all the Israeli people expected me to be their king because I am David's oldest son. But that did not happen. Instead, my younger brother became king, because that is what Yahweh wanted. 16 Now I have one thing that I request you to do. Please do not refuse to do it.” She replied, “Tell me what you want me to do.”
17 He said, “Please ask King Solomon to give to me Abishag, the woman from Shunem town, to be my wife. I am sure that he will not refuse.”
18 Bathsheba replied, “Okay, I will speak to the king for you.”
19 So Bathsheba went to King Solomon, to tell him what Adonijah wanted. The king got up from his throne and went to greet her and bowed down to her. Then he sat on his throne again and asked someone to bring a chair for her. So she sat down at the king's right side.
20 Then she said, “I have one small thing which I want you to do; please do not say that you will not do it.” The king replied, “Mother, what do you want? I will not refuse you.”
21 She said, “Allow Abishag to be given to your older brother Adonijah to be his wife.”
22 The king replied angrily, “What? Are you requesting me to give Abishag to Adonijah? Does he want me to allow him to rule the kingdom, too? Because he is my older brother, does he think that he should be the king? Does he think that Abiathar should be the priest instead of Zadok, and that Joab should be the army commander instead of Benaiah because they supported him when he tried to become the king?”
23 Then Solomon solemnly promised, requesting Yahweh to listen, “I wish God to strike me and kill me if I do not cause Adonijah to be executed for requesting this! 24 Yahweh has appointed me to be the king and placed me here to rule [MTY] as my father David did. He has promised that my descendants [MTY] will be the kings of Israel. So just as surely as Yahweh lives, I solemnly promise that Adonijah will be executed today!” 25 So King Solomon gave orders to Benaiah to go and kill Adonijah, and Benaiah did that.
26 Then Solomon said to Abiathar the priest, “Go to Anathoth town, to your land there. You deserve to be killed, but I will not execute you now, because you were the one who supervised the men who carried Yahweh's Sacred Chest for David my father, and you endured all the troubles that my father endured.” 27 So Solomon dismissed Abiathar from being the priest of Yahweh. By doing that he caused to happen what Yahweh had said many years previously at Shiloh, that some day he would get rid of the descendants [MTY] of Eli.
28 Joab had not supported Absalom when he tried to become the king, but he had supported Adonijah. So when Joab heard what had happened, he ran to the Sacred Tent, and he grasped the projections on the corners of the altar, because he knew that no one would kill him there. 29 When someone told Solomon that Joab had run to the Sacred Tent and was standing alongside the altar, Solomon told Benaiah, “Go and execute Joab.”
30 So Benaiah went to the Sacred Tent and said to Joab, “The king commands that you come out.” But Joab replied, “No, I will die here.” So Benaiah went back to the king and reported what he had said to Joab, and what Joab had replied.
31 The king replied to him, “Do what he has requested. Kill him and bury his body. If you do that, I and my descendants [MTY] will no longer be punished for what Joab did when he killed [MTY] two men who ◄were innocent/had not done anything that is wrong►. 32 But Yahweh will punish [MTY] Joab for attacking and killing Abner, the commander of the army of Israel, and Amasa, the commander of the army of Judah, two men who were more righteous and better [DOU] men than he is. My father David did not even know that Joab was planning to murder them. 33 Joab and his descendants will be punished [IDI] forever for his murdering Abner and Amasa. But things will forever go well for David's descendants [MTY] who rule [MTY] as King David did.”
34 So Benaiah went into the Sacred Tent and killed Joab. Joab was buried on his property in the desert part of Judah. 35 Then the king appointed Benaiah to be the commander of the army instead of Joab, and he appointed Zadok to be the priest instead of Abiathar.
36 Then the king sent a messenger to summon Shimei, and the king said to him, “Build a house for yourself here in Jerusalem. Remain there and do not leave the city to go anywhere. 37 Be sure that the day that you leave Jerusalem and go across the Kidron Brook, you will be executed, and it will be ◄your own fault/what you deserve►.”
38 Shimei replied, “Your Majesty, what you say is good. I will do what you have said.” So Shimei remained in Jerusalem for several years.
39 But three years later, two of Shimei's slaves ran away. They went to stay with Maacah's son Achish, the king of Gath city. When someone told Shimei that they were in Gath, 40 he put a saddle on his donkey and got on the donkey and went to Gath. He found his slaves staying with King Achish and brought them back home.
41 But someone told King Solomon that Shimei had gone from Jerusalem to Gath and had returned. 42 So the king sent a soldier to summon Shimei and said to him, “I told you to solemnly promise, knowing that Yahweh [MTY] was listening, that you must not leave Jerusalem. I told you [RHQ], ‘Be sure that if you ever leave Jerusalem, you will be executed.’ And you replied [RHQ] to me, ‘What you have said is good; I will do what you have said.’ 43 So why did you not do what you solemnly promised to Yahweh? Why did you disobey what I commanded you?”
44 The king also said to Shimei, “You know in your inner being all the evil things that you did to my father David. So Yahweh will now punish you for the evil things that you did. 45 But Yahweh will bless me, and he will enable David's descendants [MTY] to rule forever.”
46 Then the king gave an order to Benaiah, and he went and killed Shimei.
So Solomon was completely in control of the kingdom.