Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9267071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:27:51+00:00 2026-06-18T14:27:51+00:00

I have processes that after started, bind to an address and port. These processes

  • 0

I have processes that after started, bind to an address and port. These processes are run in screen using exec so that the screen closes when the child process closes.

When killing the process, I use kill -9 PID, but sometimes the screen ends, yet when I restart the process, the old process is still using the port, and I have to terminate the process again.

I’ve also read that SIGKILL leaves sockets open, stale memory, random resources in use, so I turned to just plain kill PID, which is a SIGTERM.

Is a SIGTERM guaranteed to allow the process to unbind from the address and port, or is there a better alternative?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:27:52+00:00Added an answer on June 18, 2026 at 2:27 pm

    If you SIGKILL all the processes that keep a listening port open, it is guaranteed to close.

    However, it might not close for a few minutes, while it’s in the TIME_WAIT state, as required by the TCP specification (to let listening clients know the port is closed in case they miss the original closing packet).

    Well behaved servers will open the socket with the option SO_REUSEADDR, allowing it to reclaim the same port on restart immediately, but this is application specific. Without it, the port will appear to be in use for a few minutes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two processes: a server that should be run in background, but starts
I have started an app with forever start app.js After that I typed, forever
I have a process that is started via subprocess.Popen() which is meant to run
I want to get specific counters for processes that I have process id's for.
I've a somewhat silly question, if i have a series of processes that are
I have an application that processes files in a directory and moves them to
I have a site that processes orders taken by phone into a SQL database.
I have the following code that processes an INotification (custom interface) var mgr =
We have a few processes in Java that use nanoTime for internal benchmarking (since
I have a Windows batch file that processes all the files in a given

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.