I was working on solving the Not Listening new port problem
And I put these codes, but after listen new port responded this other crash occurred in nginx server
As conclusion:
Your must design your service (program, script, command) to listen at the desired port 3000 and when this port is not used by some other service, when you start your service it will start to listen to the port.
In other hand if you need something to listen constantly at :::3000 in order to do your tests, the most easiest way, in my opinion, is to create systemd unit. For this purpose:
Create /etc/systemd/system/listen-3000.service:
sudo nano /etc/systemd/system/listen-3000.service
As content of /etc/systemd/system/listen-3000.service place:
[Unit]
Description=Permanent listen at :::3000
After=network-online.target
[Service]
User=root
ExecStart=/usr/bin/nc -l6 3000
ExecStop=/usr/bin/killall -s KILL nc
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target
Enable and start the listen-3000.service:
sudo systemctl daemon-reload
sudo systemctl enable listen-3000.service
sudo systemctl start listen-3000.service
sudo systemctl status listen-3000.service
Disable and stop the listen-3000.service:
sudo systemctl stop listen-3000.service
sudo systemctl disable listen-3000.service