How to release the port used by a terminated process - windows

I have a service that was running on port 8080. I restarted the said service and when it started again, it was already giving an error that the port was being used.
I then tried Process Hacker 2, TCPView and CurrPorts to find the process using the port and terminate it but unfortunately, I cannot find it.
I then have to restart the whole hardware/machine just to free up the port which is not preferable. And if I restart the service again, I have to restart the whole system... again.
I'm using Windows Server 2012 R2. The service was started by PM2.
So how do I release this port that is being used but is not really being used?
Note: This issue only started a few days ago, before that everything was OK. (right after a windows update)

Related

Docker backend service is suddenly stopping while docker service stays running, why is this happening and how to resolve it?

I am running docker on a windows server 2019 VM. Docker has been working fine on that machine for a year now. But suddenly, last week docker engine was suddenly stopping and so all the containers were not running. Note that the server was not restarted since December (2 months ago).
When I log into the machine as administrator and click on the whale icon, everything restarts but I want to know what the issue is and how I can resolve it without having to log into the server on a daily basis and restart the service.
I set up windows monitoring for com.docker.backend and com.docker.service with elapsed time counter which shows how long the services have been up for.
The graphs clearly show that at one point docker backend dies and only restarts when I log in as Administrator to the server.
I also restart docker engine in debug mode hoping that that will give us more information but unfortunately all it shows is the logs when the docker engine is running and not a single piece of info on why it stopped.

Intellij stops process but port is still used

MacOS 10.15.5
Intellij 2020.2
I have a java application which starts HTTP server on port 4232. I stopped the application (sometimes it hangs and I need to use force (red skull icon) button). Then I launch the app one more time and I get that cannot start port is already used.
Fine, so I try to find that process and kill it.
I use lsof to find pid which uses that port - but nothing.
It is not intellij issue, because I can telnet to localhost 4232, so something uses that port.
Could you tell me how can I debug it? I know that reboot is a solution but it is not a preferred solution.
I found many posts with similar questions but nothing helps - I just cannot find what uses this port.

My Windows Service Won't restart on Failure as stated in the script "sc.exe" Windows

I have a service well running and configured on my windows OS The service runs as the PC starts, but some times it crashes when there is no internet connection on PC boot and due to that, it does not start at all. My goal is to let that service restart on failure for a few seconds until internet is back else.
I've followed what is written in the Microsoft documentation and I used the "sc.exe" commandline tool to accomplish this.
Here is the command I've used:
C:\Windows\System32\sc.exe failure $nameOfService reset= 10 actions= restart/1000/restart/5000/restart/100000
But, when I test my service, it does not restart. Please is there something wrong with the above command ?

Jenkins Windows slave sometime hangs after second "Build on" step

I've a Windows Server 2012 R2 based Hyper-V Host, which contains a Windows Server 2012 R2 VM as a VPN using RRAS and another VM running Debian plus the Jenkins (latest version) master server. Using this VPN, a private hosted Windows Server 2012 R2 VM act as Jenkins slave using those VPN connection. For better distinction, call this one node1.
This is bascially working as expected, but there is a problem: Sometimes, when I start a buildjob on node1, it hangs. Only the first 2 steps (Started through user XYZ and Build on slave node1 in workspace C:\jenkins are shown in the log, then nothing happens. On the master, the node1 is shown as online and is connected to the VPN.
Currently I start Jenkins using a windows task. Using this method, the above happens only sometimes. But as I configured the server, I tried to solve this in a cleaner way by registering Jenkins as Windows Service. As Windows Service, I had the same behavior: In the web panel Node1 is shown as online, but when I start a job on it I only come to Build on slave node1 and then it stops.
Normally the next step should be fetching the latest source code from my git repo. I already had the problem but now found out that it has something to do how Jenkins is started. But for me it seems very strange because running the slave as a Windows Service hasn't worked at least one time, and by running it as a Task it works most of the time.
I only found out that the problem also occurs when I start a job directly after node1 boots. When I then cancel the hanging Job and start it again, it seems to work for a while.
There are few options that I can think of them. According to Jenkins Wiki
If the slave is supposed to start desktop applications you have to
allow the service to interact with the desktop
(Action->Properties->Logon->Allow service to interact with desktop).
Another option can be that Windows services don't have the ability to interact with the windows desktop, meaning that some UI tests might no work as you expect. Do any of the steps may need interacting with the desktop (Windows GUI)?
Just for the sports how about to setup a temporary clean windows server to act as node2 (Jenkins slave) and to check if the problem is been reproduced?

Unable to stop the IIS Services

Good Day,
I have just installed MySQL workbench and try to run this but the error message is pop up Your connection attempt is failed for user root. When I hit the localhost from my browser it open up the IIS7 page.First I have stopped the services using IIS UI but it didn't work then I have unmarked the IIS from the Windows Turn Feature On/Off and also gave the restart to my machine but it still ping to IIS7. I have also tried the alternate way which was mentioned in the already discussed thread using cmd type iisretart /stop etc. Any guidelines to stop the services of IIS without uninstalling it? Help will be appreciated. Thanks
in the same way for iis7 you can try:
net stop WAS (type Y and then press enter to also stop W3SVC)
net start W3SVC (this starts both WAS and W3SVC)
Try running cmd as administrator and then typing:
net stop MsDepSvc
You can also start the service by typing:
net start MsDepSvc
This will stop or start the Remote agent service for the Microsoft Web Deploy 2.0.

Resources