killgo with the /go/killgo Command

/go/killgo is meant to stop a Go service that listens on port 8080, for example when it hangs. It finds the processes that use port 8080 and ends each of them with kill -9, which stops a program at once and gives it no chance to save its work. The command does not check what a process is. It stops every process that has a network connection with port 8080 at either end. That includes: Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# See what is using port 8080
ss -ltnp 'sport = :8080'

# Stop it
/go/killgo

Examples

# Show which program listens on port 8080
ss -ltnp 'sport = :8080'

# Show everything that uses port 8080, which is what killgo will stop
lsof -i :8080

# Stop only the program that listens (a gentler way to do it by hand)
kill <pid>

Output

The command prints nothing. You may see kill: errors, for example No such process.

The exit code is 0 in most cases.

Logging

Every run is appended to /var/log/go/killgo.log.

See the full reference at /go/killgo and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *