How do I “kill” an ORDS process?
FYI: This was all done on a MacBook, so...this may differ on a PC or Linux machine. Apologies m'Lord...
UPDATE: Here are some helpful references for Windows/PC and macOS/Linux, too!
Since I’ve written this article, I’ve done some more digging. Some version of this will go into our documentation. I’m just not sure how much! But here are some of my findings:
“…searching for an ORDS and JVM Process ID.” Can be done with:
macOS/Linux | ps |
Windows: Command Prompt | tasklist |
Windows: PowerShell | Get-Process |
macOS | Activity Monitor (application) |
Windows | Task Manager (application) |
macOS/Linux | kill [ ORDS PID] [JVM PID] |
Command Prompt | taskkill /PID PID /PID [ORDS PID] /PID [JVM PID] /F |
Powershell | Stop-Process -ID [ORDS PID],[JVM PID] -Force |
macOS Activity Monitor | End a process manually (with the mouse) |
Windows Task Manager | End a process manually (with mouse) |
macOS/Linux:
PowerShell details:
Command prompt:
Here are the options I’ve found to “kill
” an ORDS process:
- Use the
kill
command followed by the ORDS PID (i.e., Process ID) and the related JVM (i.e., Java Virtual Machine) PID - Press the Control + C keys in the same terminal session that ORDS is running in (assuming it remains uninterrupted)
It looks like we’ve included in our docs how to start ORDS (with the ords serve
command), but we leave it up to you to figure out how to close down/kill/terminate an ORDS process.
FYI: As I'm writing this PSA, I'm also filing a ticket to update our docs too 🤓!
Some observations
First approach
The Control + C key
option is the simplest option. But this might be the most impractical. If you start ORDS in Standalone mode (using the embedded Jetty server), then you might have ORDS running in its own terminal tab, kind of like this:
Assuming this is the case, while ORDS is running in a separate tab, you can issue the ps
command to review a list of the running processes:
Afterward, you can return to where ORDS is running and press and hold the Control
key followed by the C
key. You’ll see a new shell prompt appear:
There isn’t any real feedback (maybe we should change that). But if you issue the ps
If you run the command in a new tab, you’ll see that both the ORDS and Java processes have been “killed.” This signifies that ORDS and the JVM are dead—RIP 🪦.
Second approach
If you exit out of a terminal session but ORDS is still running (which, in practice, is entirely possible), you’ll have to search for the appropriate PIDs. The easiest way I’ve found is to issue the ps
command (like you saw before) and then issue the kill
command plus the relevant PIDs.
I’m unsure if you need to “kill
” the Java process and ORDS. I assume that you do. The only basis I have for this assumption is that when you use the first approach (see above), both the JVM and ORDS are killed. So, I’m attempting to mimic what automatically happens when using the Control + C
option.
Issuing the kill
command results in the following message (which you’ll see, assuming the original ORDS terminal window is still viewable):
And if you reissue the ps
command, you’ll see both the ORDS and JVM PIDs have disappeared:
Summary
Since I’ve only tested this in ORDS Standalone mode, I can’t comment on Apache Tomcat or Weblogic. I’m assuming they both function very similarly. But if you are using ORDS as both an admin (to get it up and running) and a developer, then some of these commands (that we take for granted) may not be obvious to you. So, as rudimentary and fundamental as this article appears, I hope it helps at least one person early on in their database or ORDS journey.
Call to Action
And if you haven’t seen it by now (and why should you? I haven’t plugged it yet), we’ve made a YouTube playlist to accompany one of our more popular ORDS LiveLabs. You can find the LiveLab here.
And here’s the complete playlist:
That’s all for now, folks!
Follow
And don’t forget to follow, like, subscribe, share, taunt, troll, or stalk me!