stopping node-red: Unable to listen on http://127.0.0.1:1880/ - beagleboneblack

I'm trying to add the dashboard nodes to node-red on a Beaglebone.
In several places on the Internet, instructions for adding features to node-red begin by saying "stop node-red". But they don't say how to do that.
On the Beaglebone Black WiFi, node-red v0.15.2 comes installed and starts automatically. So far as I can tell, the command
sudo node-red stop
should stop it, but this always results in a string of messages that end up with
19 May 16:13:05 - [warn] Communication server error: Error: listen EADDRINUSE :::1880
19 May 16:13:05 - [error] Unable to listen on http://127.0.0.1:1880/
19 May 16:13:05 - [error] Error: port in use
Nothing I've found tells how to get beyond this. The closest was a post that suggested running
ps -ef
and then killing all the node-red processes, but the next post in that sequence indicated that the result was that they immediately restarted themselves.
What is the correct way to stop node-red on the Beaglebone?
Or more generally, how can I add the dashboard module to the existing node-red preinstalled on the Beaglebone Black?
Thanks!

Node-RED is being run under SystemD as a service
use:
sudo service nodered stop
Also node-red stop won't stop Node-RED it will just try and start a new instance with a flow files called stop. The command you were probably looking for is node-red-stop (notice the hyphen between red and stop).
Also you do not need to stop Node-RED to install a new set of nodes, you can just install them then restart Node-RED and it will pick up the new nodes. So install and kill should work,

Related

DispatchSource.makeReadSource is holding onto socket after app is killed by Xcode [duplicate]

I am attempting to bind a socket to a port below:
if( bind(socket_desc,(struct sockaddr *) &server, sizeof(server)) < 0)
{
perror("bind failed. Error");
return 1;
}
puts("bind done");
But it gives:
$ ./serve
Socket created
bind failed. Error: Address already in use
Why does this error occur?
Everyone is correct. However, if you're also busy testing your code your own application might still "own" the socket if it starts and stops relatively quickly. Try SO_REUSEADDR as a socket option:
What exactly does SO_REUSEADDR do?
This socket option tells the kernel that even if this port is busy (in
the TIME_WAIT state), go ahead and reuse it anyway. If it is busy,
but with another state, you will still get an address already in use
error. It is useful if your server has been shut down, and then
restarted right away while sockets are still active on its port. You
should be aware that if any unexpected data comes in, it may confuse
your server, but while this is possible, it is not likely.
It has been pointed out that "A socket is a 5 tuple (proto, local
addr, local port, remote addr, remote port). SO_REUSEADDR just says
that you can reuse local addresses. The 5 tuple still must be
unique!" by Michael Hunter (mphunter#qnx.com). This is true, and this
is why it is very unlikely that unexpected data will ever be seen by
your server. The danger is that such a 5 tuple is still floating
around on the net, and while it is bouncing around, a new connection
from the same client, on the same system, happens to get the same
remote port. This is explained by Richard Stevens in ``2.7 Please
explain the TIME_WAIT state.''.
You have a process that is already using that port. netstat -tulpn will enable one to find the process ID of that is using a particular port.
Address already in use means that the port you are trying to allocate for your current execution is already occupied/allocated to some other process.
If you are a developer and if you are working on an application which require lots of testing, you might have an instance of your same application running in background (may be you forgot to stop it properly)
So if you encounter this error, just see which application/process is using the port.
In linux try using netstat -tulpn. This command will list down a process list with all running processes.
Check if an application is using your port. If that application or process is another important one then you might want to use another port which is not used by any process/application.
Anyway you can stop the process which uses your port and let your application take it.
If you are in linux environment try,
Use netstat -tulpn to display the processes
kill <pid> This will terminate the process
If you are using windows,
Use netstat -a -o -n to check for the port usages
Use taskkill /F /PID <pid> to kill that process
The error usually means that the port you are trying to open is being already used by another application. Try using netstat to see which ports are open and then use an available port.
Also check if you are binding to the right ip address (I am assuming it would be localhost)
if address is already in use can you just want to kill whoso ever process is using the port, you can use
lsof -ti:PortNumberGoesHere | xargs kill -9
source and inspiration this.
PS: Could not use netstat because it not installed already.
As mentioned above the port is in use already.
This could be due to several reasons
some other application is already using it.
The port is in close_wait state when your program is waiting for the other end to close the program.refer (https://unix.stackexchange.com/questions/10106/orphaned-connections-in-close-wait-state).
The program might be in time_wait state. you can wait or use socket option SO_REUSEADDR as mentioned in another post.
Do netstat -a | grep <portno> to check the port state.
It also happens when you have not give enough permissions(read and write) to your sock file!
Just add expected permission to your sock contained folder and your sock file:
chmod ug+rw /path/to/your/
chmod ug+rw /path/to/your/file.sock
Then have fun!
I was also facing that problem, but I resolved it.
Make sure that both the programs for client-side and server-side are on different projects in your IDE, in my case NetBeans. Then assuming you're using localhost, I recommend you to implement both the programs as two different projects.
To terminate all node processes:
killall -9 node
First of check which port are listening,
netstat -tlpn
then select available port to conect,
sudo netstat -tlpn | grep ':port'
Fix it into also to your server and clients interfaces. Go Barrier tab -> change settings, -> port value type -> save/ok
Check both clients and server have similar port values
Then Reload.
Now it should be ok.
Check for running process pid:
pidof <process-name>
Kill processes:
sudo kill -9 process_id_1 process_id_2 process_id_3

Windows 10 Pro and Docker service -- is it possible to start the Docker service later?

The problem I face is that the first time the Docker service on my Windows 10 pro computer is started at boot time, then I get all kinds of errors. Restarting the Docker service solves always the problem.
On my Windows 10 pro computer the Docker Service is started automatically. The problem is that the service starts a bit too early. I know about the Windows Fastboot but changing that I find to heavy to configure that to solve this problem.
Is there a way to configure the Docker service to start later in the Windows 10 boot sequence?
You think - make it a program that is started automatically. When I configure Docker NOT as a service, then I get all kinds of problems. The Docker system tray icon sometimes even gets the red color ...
The error messages are:
ERROR: for docker-compose_geosolschmea_1 Cannot start service
geosolschmea: driver failed programming external connectivity on
endpoint docker-compose_geosolschmea_1
(3c0302743b124c050334b9ca3fcd3c9b01a0bcfaa1d629d74f7311cb09a58833):
Error starting userland proxy: mkdir
/port/tcp:0.0.0.0:3306:tcp:172.18.0.2:3306: inpuStarting
docker-compose_jenkins_1 ... error
ERROR: for docker-compose_jenkins_1 Cannot start service jenkins:
driver failed programming external connectivity on endpoint
docker-compose_jenkins_1
(fa039afd6930afba9843b89295e1bbeab32102679964780f867df1cd13282fe0):
Error starting userland proxy: mkdir
/port/tcp:0.0.0.0:8888:tcp:172.18.0.3:8080: input/output error

cannot run shellinabox through a php api on centos

I want to start shellinabox on centos through a php api.
When the user hits the api, shellinaboxd -p 'portno' command should get executed and shellinabox should start on the particular port number.
But this does not happen, instead this error comes
Error :
Failed to find any available port [on tail -f /var/log/httpd/error_log]
The code below runs correctly on ubuntu but not on centos.
Consider rest all things working fine.
$app->get('/test', function() {
exec('shellinaboxd -p '.$port);
});
Executing:
shellinaboxd -p 'someport' on bash also works fine.
I have php5.5 and apache2 installed on my system.
Error message Failed to find any available port tells you that port is already used.
Try different port.
I have come out with a solution. Centos is SELINUX(Secured linux). So it does not allow any logging action from a process, like php api(in my case, whose user is apache) in its default mode that is "enforcing".
So change the SELINUX mode as:
'SELINUX=disabled' in /etc/selinux/config
and reboot.
It has one more mode i.e. permissive.
Read more about it here: https://wiki.centos.org/HowTos/SELinux

neo4j server is not restarting or stopping

I am getting the following errors and I dont know how to restart the server .I tried multiple times but I get the same error all the time.How can I stop and restart the server.I really appreciate any help.
./bin/neo4j start
displays:
/usr/local/neo4j/data/log/console.log: Permission denied
process [11825]... waiting for server to be ready.. Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
sudo ./bin/neo4j start
displays:
Another server-process is running with [ST=ESTABLISHED], cannot start a new one. Exiting.
The exception you get is because another server is running.
Also, there is another exception, you don't have write access in the folder for the logs.
Check if http://localhost:7474 is displaying the neo4j web browser.
If yes, locate the location of the running database :
Then go to the location and stop the db, eg based on the image :
cd /Users/cw/_graphs/tests
./bin/neo4j stop
If it is not working, try to kill the process :
sudo htop
kill -9 10522
And try to run your new database. And make sure you have the right permissions for the stores and logs.

start-stop-daemon: user 'neo4j' not known

I've installed neo4j to a VM running Ubuntu (on the koding dot com platform). It shows in a dpkg-query so I'm sure its installed.
To start the server I use the command:
sudo service neo4j-service start
This doesn't start the sservice but generates and error message:
start-stop-daemon: user 'neo4j' not known
Should I start again, removing the packagage and reinstalling? Or is there a way to add this user or to use the root user?
Reinstall the package to add the user 'neo4j'.

Resources