Issue: Cannot Start Metasploit Service after Software Update
I have encountered this issue several times after installing software update in Metasploit Pro. Supposedly, after the installation is complete, the page should go back to the Projects page, however, in this case it is stuck in the “updating” page.

To fix this, I need to be logged in the to the Metasploit console server via SSH. Find the Metasploit installation folder and run the ctlscript.sh to check the status of Metasploit services.
Normally, Metasploit installation is saved in /opt/metasploit. So, to check the services running, run this command: /opt/metasploit/ctlscript.sh status metasploit
My result was as follows:metasploit-ui.service - Metasploit Pro web service
Loaded: loaded (/usr/local/lib/systemd/system/metasploit-ui.service; static)
Active: inactive (dead) since Mon 2024-05-06 13:02:44 PST; 58min ago
Process: 372522 ExecStart=/opt/metasploit/ruby/bin/ruby ./proui.rb (code=exited, status=0/SUCCESS)
Process: 372523 ExecStartPost=/opt/metasploit/scripts/wait_for_port ${PORT} (code=exited, status=0/SUCCESS)
Main PID: 372522 (code=exited, status=0/SUCCESS)
CPU: 20.602s
The result above means the web service of Metasploit failed to start. To fix this, issue this command:
./ctlscript.sh start metasploit
./ctlscript.sh status metasploit
Upon checking the status after starting the web service:● metasploit-ui.service - Metasploit Pro web service
Loaded: loaded (/usr/local/lib/systemd/system/metasploit-ui.service; static)
Active: active (running) since Mon 2024-05-06 14:02:10 PST; 4s ago
Process: 373813 ExecStartPost=/opt/metasploit/scripts/wait_for_port ${PORT} (code=exited, status=0/SUCCESS)
Main PID: 373810 (.ruby.bin)
Tasks: 2 (limit: 19091)
Memory: 261.2M
CPU: 18.873s
CGroup: /system.slice/metasploit-ui.service
└─373810 /opt/metasploit/ruby/bin/.ruby.bin ./proui.rb
Then, check the Metasploit service status:service metasploit status
Service status is still saying failed:× metasploit.service - Metasploit Pro services
Loaded: loaded (/usr/local/lib/systemd/system/metasploit.service; static)
Active: failed (Result: timeout) since Mon 2024-05-06 13:44:45 PST; 17min ago
Process: 373074 ExecStart=/opt/metasploit/scripts/wait_for_port ${PORT} (code=killed, signal=TERM)
Main PID: 373074 (code=killed, signal=TERM)
CPU: 1.615s
Run this command to start the Metasploit service:service metasploit startservice metasploit status
This time, starting the service should succeed:● metasploit.service - Metasploit Pro services
Loaded: loaded (/usr/local/lib/systemd/system/metasploit.service; static)
Active: active (exited) since Mon 2024-05-06 14:02:43 PST; 41s ago
Process: 373894 ExecStart=/opt/metasploit/scripts/wait_for_port ${PORT} (code=exited, status=0/SUCCESS)
Main PID: 373894 (code=exited, status=0/SUCCESS)
CPU: 979ms