Can't start Varnish on port 80 CentOS v7.9.2009 kvm [ns] - Error: -a arguments localhost:8443 and localhost:8443 have same address - centos

Would you guys please help. I installed Varnish before & worked following: https://computingforgeeks.com/install-varnish-cache-for-apache-nginx-on-centos/. It recently doesn't work anymore. Have no idea why.
[root#ns ~]# systemctl status varnish.service
● varnish.service - Varnish Cache, a high-performance HTTP accelerator
Loaded: loaded (/usr/lib/systemd/system/varnish.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-03-02 08:41:43 UTC; 10s ago
Process: 22134 ExecStart=/usr/sbin/varnishd -a :80 -a localhost:8443,PROXY -p feature=+http2 -f /etc/varnish/default.vcl -s malloc,256m (code=exited, status=255)
Mar 02 08:41:42 [nameserver url] systemd[1]: Starting Varnish Cache, a high-performance HTTP accelerator...
Mar 02 08:41:42 [nameserver url] varnishd[22134]: Error: -a arguments localhost:8443 and localhost:8443 have same address
Mar 02 08:41:42 [nameserver url] varnishd[22134]: (-? gives usage)
Mar 02 08:41:43 [nameserver url] systemd[1]: varnish.service: control process exited, code=exited status=255
Mar 02 08:41:43 [nameserver url] systemd[1]: Failed to start Varnish Cache, a high-performance HTTP accelerator.
Mar 02 08:41:43 [nameserver url] systemd[1]: Unit varnish.service entered failed state.
Mar 02 08:41:43 [nameserver url] systemd[1]: varnish.service failed.
I guess the issue is:
Mar 02 08:41:42 [nameserver url] varnishd[22134]: Error: -a arguments localhost:8443 and localhost:8443 have same address
Ran netstat -ltnp to check ports :8443
[root#ns ~]# netstat -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:2095 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 1866/perl
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 612/rpcbind
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 21294/httpd
tcp 0 0 0.0.0.0:2096 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 822/exim
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1720/pdns_server
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1444/pure-ftpd (SER
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1750/sshd
tcp 0 0 0.0.0.0:8088 0.0.0.0:* LISTEN 9669/openlitespeed
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1720/pdns_server
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 822/exim
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 21294/httpd
tcp 0 0 0.0.0.0:2077 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:2078 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 127.0.0.1:446 0.0.0.0:* LISTEN 1488/docstore
tcp 0 0 0.0.0.0:52223 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2079 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:52224 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2080 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:2082 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:52227 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2083 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:52228 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:52229 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:52230 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2086 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:52231 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2087 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:7080 0.0.0.0:* LISTEN 9669/openlitespeed
tcp 0 0 0.0.0.0:52232 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2090 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:2091 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 1718/redis-server 1
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 1443/memcached
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 822/exim
tcp6 0 0 :::110 :::* LISTEN 1461/dovecot
tcp6 0 0 ::1:783 :::* LISTEN 1866/perl
tcp6 0 0 :::143 :::* LISTEN 1461/dovecot
tcp6 0 0 :::111 :::* LISTEN 612/rpcbind
tcp6 0 0 :::8080 :::* LISTEN 21294/httpd
tcp6 0 0 :::465 :::* LISTEN 822/exim
tcp6 0 0 :::53 :::* LISTEN 1720/pdns_server
tcp6 0 0 :::21 :::* LISTEN 1444/pure-ftpd (SER
tcp6 0 0 :::4949 :::* LISTEN 847/perl
tcp6 0 0 :::22 :::* LISTEN 1750/sshd
tcp6 0 0 :::25 :::* LISTEN 822/exim
tcp6 0 0 :::443 :::* LISTEN 21294/httpd
tcp6 0 0 :::52223 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52224 :::* LISTEN 2190/im360: master
tcp6 0 0 :::993 :::* LISTEN 1461/dovecot
tcp6 0 0 :::52227 :::* LISTEN 2190/im360: master
tcp6 0 0 :::995 :::* LISTEN 1461/dovecot
tcp6 0 0 :::52228 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52229 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52230 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52231 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52232 :::* LISTEN 2190/im360: master
tcp6 0 0 :::3306 :::* LISTEN 2008/mysqld
tcp6 0 0 :::11211 :::* LISTEN 1443/memcached
tcp6 0 0 :::587 :::* LISTEN 822/exim
But I found no such port. Tried to restart Apache, and server and varnish. No help. Have you guys met the similar issue? How can I fix this? Thank you in advance

I run the default varnish service config file using:
$ sudo vi /etc/systemd/system/multi-user.target.wants/varnish.service
ExecStart=/usr/sbin/varnishd \
-a :80 \
-a localhost:8443,PROXY \
-p feature=+http2 \
-f /etc/varnish/default.vcl \
-s malloc,256m
ExecReload=/usr/sbin/varnishreload
I think the issue is this one. Remove and Varnish works again. But I am not sure if it cause trouble somewhere else.
-a localhost:8443,PROXY \

Related

WEBOS LG TV: ares-inspect WARN Session#forward() failed forwarding client localPort: 0 => devicePort: 9998

I need to debug app running on the tv
The command I am running
ares-inspect -d webOS_TV -a myapp --open
The error I am getting
> Session#forward() failed forwarding client localPort: 0
> (inCnx.remotePort: 55431 )=> devicePort: 9998 ares-inspect WARN
> Session#forward() failed forwarding client localPort: 0 => devicePort:
> 9998 Session#forward() failed forwarding client localPort: 0
> (inCnx.remotePort: 55432 )=> devicePort: 9998 ares-inspect WARN
> Session#forward() failed forwarding client localPort: 0 => devicePort:
> 9998 Application Debugging - http://localhost:55430 Session#forward()
> failed forwarding client localPort: 0 (inCnx.remotePort: 55438 )=>
> devicePort: 9998 ares-inspect WARN Session#forward() failed forwarding
> client localPort: 0 => devicePort: 9998
Please help
I cannot find any 9998 port running on my TV
ares-novacom -d webOS_TV --r 'netstat -at'
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:1900 0.0.0.0:* LISTEN
tcp 0 0 localhost:43725 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1266 0.0.0.0:* LISTEN
tcp 0 0 localhost:domain 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:afs3-fileserver 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssg_http 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssg_https 0.0.0.0:* LISTEN
tcp 0 0 localhost:43259 0.0.0.0:* LISTEN
tcp 0 0 localhost:39547 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1979 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1088 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:9922 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1602 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:dial_http 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:dial_tvapp 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1927 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:11111 0.0.0.0:* LISTEN
tcp 0 0 192.168.0.106:dial_http 192.168.0.102:47096 ESTABLISHED
tcp 0 0 localhost:39547 localhost:50092 ESTABLISHED
tcp 0 0 localhost:39726 localhost:43259 ESTABLISHED
tcp 0 0 192.168.0.106:ssg_https 192.168.0.103:40102 ESTABLISHED
tcp 0 0 192.168.0.106:ssg_https 192.168.0.103:40056 ESTABLISHED
tcp 0 0 192.168.0.106:57364 192.168.0.103:38520 TIME_WAIT
tcp 0 0 192.168.0.106:9922 192.168.0.107:49603 ESTABLISHED
tcp 1 0 192.168.0.106:41720 192.168.0.1:60440 CLOSE_WAIT
tcp 0 0 192.168.0.106:57352 192.168.0.103:38520 TIME_WAIT
tcp 0 0 192.168.0.106:ssg_https 192.168.0.103:40046 ESTABLISHED
tcp 0 0 192.168.0.106:11111 192.168.0.107:65512 CLOSE_WAIT
tcp 0 0 localhost:50092 localhost:39547 ESTABLISHED
tcp 0 0 192.168.0.106:57358 192.168.0.103:38520 TIME_WAIT
tcp 0 0 localhost:43259 localhost:39726 ESTABLISHED
tcp 224 0 192.168.0.106:11111 192.168.0.107:65511 CLOSE_WAIT
tcp 0 0 :::36718 :::* LISTEN
tcp 0 0 localhost:domain :::* LISTEN
tcp 0 0 :::9922 :::* LISTEN
I had installed the prod app and the local app has the same id so they were conflicted

ERROR: transport error 202: bind failed: Cannot assign requested address

When I am trying to use sbt shell in intelliJ it appears the following error message:
Do I miss any settings?
Update
netstat -planet
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 0.0.0.0:41351 0.0.0.0:* LISTEN 1000 353424 573/java
tcp 0 0 127.0.0.1:63342 0.0.0.0:* LISTEN 1000 355674 573/java
tcp 0 0 0.0.0.0:33295 0.0.0.0:* LISTEN 1000 354289 573/java
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 101 16065 -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 0 34359 -
tcp 0 0 127.0.0.1:6942 0.0.0.0:* LISTEN 1000 354471 573/java
tcp 0 0 10.0.2.15:42510 151.101.193.69:443 ESTABLISHED 1000 305742 5102/chromium-brows
tcp 0 0 10.0.2.15:44344 104.66.167.140:443 ESTABLISHED 1000 345081 5102/chromium-brows
tcp 0 0 10.0.2.15:37646 198.252.206.25:443 ESTABLISHED 1000 353330 5102/chromium-brows
tcp 0 0 10.0.2.15:41480 104.16.29.34:443 ESTABLISHED 1000 349198 5102/chromium-brows
tcp 564 0 10.0.2.15:43148 172.217.168.42:443 ESTABLISHED 1000 377410 5102/chromium-brows
tcp 0 0 10.0.2.15:59768 54.246.222.93:443 ESTABLISHED 1000 368480 5102/chromium-brows
tcp 0 0 10.0.2.15:40474 216.58.215.226:443 ESTABLISHED 1000 327204 5102/chromium-brows
tcp 0 0 10.0.2.15:37728 198.252.206.25:443 ESTABLISHED 1000 376381 5102/chromium-brows
tcp 0 0 10.0.2.15:40470 216.58.215.226:443 ESTABLISHED 1000 327196 5102/chromium-brows
tcp 0 0 10.0.2.15:56458 34.193.164.107:443 ESTABLISHED 1000 352517 5102/chromium-brows
tcp 0 0 10.0.2.15:52954 91.228.74.181:443 ESTABLISHED 1000 377413 5102/chromium-brows
tcp 0 0 10.0.2.15:52956 91.228.74.181:443 ESTABLISHED 1000 377416 5102/chromium-brows
tcp 0 0 10.0.2.15:39020 172.217.168.66:443 ESTABLISHED 1000 324280 5102/chromium-brows
tcp 0 0 10.0.2.15:39324 216.58.215.230:443 ESTABLISHED 1000 375801 5102/chromium-brows
tcp 0 0 10.0.2.15:38640 172.217.168.38:443 ESTABLISHED 1000 352610 5102/chromium-brows
tcp 0 0 10.0.2.15:50876 172.217.168.46:443 ESTABLISHED 1000 343823 5102/chromium-brows
tcp 0 0 10.0.2.15:36630 198.252.206.25:443 ESTABLISHED 1000 327486 5102/chromium-brows
tcp 0 0 10.0.2.15:40544 216.58.215.227:443 ESTABLISHED 1000 318302 5102/chromium-brows
tcp 0 0 10.0.2.15:47506 151.101.194.49:443 ESTABLISHED 1000 353343 5102/chromium-brows
tcp 311 0 10.0.2.15:38920 13.32.166.42:443 ESTABLISHED 1000 377418 5102/chromium-brows
tcp 0 0 10.0.2.15:54224 192.30.253.125:443 ESTABLISHED 1000 317858 5102/chromium-brows
tcp 0 0 10.0.2.15:49846 172.217.168.46:443 ESTABLISHED 1000 327213 5102/chromium-brows
tcp 0 0 10.0.2.15:56456 34.193.164.107:443 ESTABLISHED 1000 351738 5102/chromium-brows
tcp 32 0 10.0.2.15:42114 52.207.55.4:443 CLOSE_WAIT 1000 374681 5102/chromium-brows
tcp6 0 0 :::43209 :::* LISTEN 1000 355214 772/java
tcp6 0 0 ::1:631 :::* LISTEN 0 34358 -
tcp6 0 0 127.0.0.1:30107 :::* LISTEN 1000 355213 772/java
tcp6 0 0 127.0.0.1:43906 127.0.0.1:33295 TIME_WAIT 0 0 -
tcp6 0 0 127.0.0.1:43904 127.0.0.1:33295 TIME_WAIT 0 0 -
tcp6 0 0 127.0.0.1:43922 127.0.0.1:33295 TIME_WAIT 0 0 -
Update 2
What do I have to set:
This used to (2015) suggest a port already in used (as in ensime/ensime-server issue 921)
You have the same error with JBoss for instance
ERROR: transport error 202: bind failed: Cannot assign requested address
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
Make sure there isn't already an sbt shell running elsewhere (netstat -planet).

nginx isn't generating any php-fpm.sock anyone have any ideas why?

I have recently built a new web server using the (LEMP) method and it's all running good, I also installed Varnish and phpMyAdmin into the lemp install.
I added unix: /var/run/php-fpm/php-fpm.sock to the location / {
Then I told www.conf to listen to /var/run/php-fpm/php-fpm.sock
however nginx isn't generating any sockets to the /var/run/php-fpm folder.
All the services are running correctly and I can access the default webpage at my-ip but trying to access anything else i.e my-ip/anythingelse gives me 502 bad gateway because it's not finding the socket.
Does anyone know what could be the cause and a fix?
Here's my nginx.conf:
user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 60;
include /etc/nginx/conf.d/*.conf;
index index.html index.htm;
server {
listen 127.0.0.1:8080;
root /usr/share/nginx/html;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 443;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/;
}
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
}
}
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2519/master
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 4010/nginx: master
tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN 4046/varnishd
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 3988/php-fpm: maste
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 2711/mysqld
tcp 0 0 0.0.0.0:38350 0.0.0.0:* LISTEN 1559/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1362/rpcbind
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 4050/varnishd
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 4010/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1361/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3500/cupsd
tcp6 0 0 ::1:25 :::* LISTEN 2519/master
tcp6 0 0 :::33209 :::* LISTEN 1559/rpc.statd
tcp6 0 0 :::111 :::* LISTEN 1362/rpcbind
tcp6 0 0 :::22 :::* LISTEN 1361/sshd
tcp6 0 0 ::1:631 :::* LISTEN 3500/cupsd
udp 0 0 0.0.0.0:59473 0.0.0.0:* 1559/rpc.statd
udp 0 0 0.0.0.0:111 0.0.0.0:* 1362/rpcbind
udp 0 0 0.0.0.0:123 0.0.0.0:* 726/chronyd
udp 0 0 127.0.0.1:323 0.0.0.0:* 726/chronyd
udp 0 0 0.0.0.0:679 0.0.0.0:* 1362/rpcbind
udp 0 0 127.0.0.1:888 0.0.0.0:* 1559/rpc.statd
udp 0 0 0.0.0.0:42032 0.0.0.0:* 685/avahi-daemon: r
udp 0 0 0.0.0.0:5353 0.0.0.0:* 685/avahi-daemon: r
udp6 0 0 :::111 :::* 1362/rpcbind
udp6 0 0 :::123 :::* 726/chronyd
udp6 0 0 ::1:323 :::* 726/chronyd
udp6 0 0 :::679 :::* 1362/rpcbind
udp6 0 0 :::60779 :::* 1559/rpc.statd
[root#localhost ~]#
Nginx is using a socket, while php-fpm listens on port 9000. You can use fastcgi_pass 127.0.0.1:9000; instead in nginx. You can also configure php-fpm to listen on a socket instead following this post.
I have solved the issue and figured out why it wasn't creating the socket...
I thought I would take extra precautions with the files I was editing and created backups in the folders... Well because of this it was including the .conf's twice which is why it was still using 127.0.0.1:9000 even though I told it to use /var/run/php-fmp/php-fpm.sock ... lesson learned - (put backups in a separate root folder.
Have another wee issue now though. *2 FastCGI sent in stderr "Primary script unknown" while reading response header from upstream?
Thank you for a push in the right direction... Had you not of mentioned to do a netstat I probably wouldn't have thought about the backup files.

SMTP & POP3 SSL Connection

I am using libetpan-1.0 open source (mail library stuff) for SMTP & POP3 access in "C" language. I have problem with SSL connection in SMTP & POP3. When i make SSL connection & connection gets fail, my socket is stay in CLOSE_WAIT state. This results in memory leak after a long time. Here is my output of command "netstat -an". I am running this application in ARM board. Can anyone tell me, what i should do? Thanks in advance.
Here is my code that i am trying.
pSmtp = mailsmtp_new(0, NULL); (Create new object)
if (SMTP_NO_ERROR != mailsmtp_ssl_connect(pSmtp, "smtp.gmail.com", 465))
{
mailsmtp_free(pSmtp);
}
else
{
// Send Mail
}
So doesn't my work is over after i call function "mailsmtp_free(pSmtp)" or
i have do other stuff to close connection.
~#netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN
tcp 1 0 192.168.51.151:4928 98.139.211.125:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4934 98.139.211.125:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2883 98.139.211.125:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4139 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4140 98.138.105.21:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.151.101:2745 TIME_WAIT
tcp 1 0 192.168.51.151:4142 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4143 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3132 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3133 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3134 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3135 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3131 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2115 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3136 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:3137 98.138.105.21:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.151.101:2761 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.151.101:2757 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.151.101:2753 TIME_WAIT
tcp 1 0 192.168.51.151:4083 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4082 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4081 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4080 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4085 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4084 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4075 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4074 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4073 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4072 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4079 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4078 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4077 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:4076 63.250.193.228:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2493 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2492 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2495 98.138.105.21:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2496 98.138.105.21:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52577 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52581 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52585 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52565 TIME_WAIT
tcp 1 0 192.168.51.151:3978 63.250.193.228:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52569 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52573 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52609 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.151.101:2748 TIME_WAIT
tcp 1 0 192.168.51.151:2743 98.139.211.125:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2742 98.139.211.125:465 CLOSE_WAIT
tcp 1 0 192.168.51.151:2744 98.139.211.125:465 CLOSE_WAIT
tcp 94 0 192.168.51.151:3650 74.125.129.108:587 CLOSE_WAIT
tcp 95 0 192.168.51.151:3655 74.125.129.108:587 CLOSE_WAIT
tcp 1 0 192.168.51.151:2250 63.250.193.228:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52578 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52582 TIME_WAIT
tcp 95 0 192.168.51.151:4618 74.125.129.108:587 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52586 TIME_WAIT
tcp 95 0 192.168.51.151:4615 74.125.129.108:587 CLOSE_WAIT
tcp 1 0 192.168.51.151:4353 98.139.211.125:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52590 TIME_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52594 TIME_WAIT
tcp 1 0 192.168.51.151:2769 98.138.105.21:465 CLOSE_WAIT
tcp 0 0 192.168.51.151:80 192.168.51.40:52598 TIME_WAIT
udp 0 0 0.0.0.0:2048 0.0.0.0:*
udp 0 0 0.0.0.0:2049 0.0.0.0:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 6 [ ] DGRAM 1262 /dev/log
unix 2 [ ] DGRAM 1993
unix 2 [ ] DGRAM 1513
unix 2 [ ] DGRAM 1511
unix 2 [ ] DGRAM 1492
You need to close them on your side.
CLOSE_WAIT means the remote side has closed the connection, but your side hasn't.
See accepted answer here

MongoDB Map Reduce

Hi I had following document in collection
{
"_id" : ObjectId("5236b303e4b074ca9f4ed453")
"Commands":{
"netstat -tulpn":"Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2285/mysqld
tcp 0 0 0.0.0.0:63342 0.0.0.0:* LISTEN 3992/java
tcp 0 0 0.0.0.0:33359 0.0.0.0:* LISTEN 1913/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1794/rpcbind
tcp 0 0 0.0.0.0:3216 0.0.0.0:* LISTEN 3485/skype
tcp 0 0 0.0.0.0:28017 0.0.0.0:* LISTEN 3821/mongod
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2628/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2147/sshd
tcp 0 0 127.0.0.1:44567 0.0.0.0:* LISTEN 11436/GoogleTalkPlu
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1987/cupsd
tcp 0 0 127.0.0.1:6942 0.0.0.0:* LISTEN 3992/java
tcp 0 0 127.0.0.1:55777 0.0.0.0:* LISTEN 11436/GoogleTalkPlu
tcp 0 0 127.0.0.1:6311 0.0.0.0:* LISTEN 5088/Rserve
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 3821/mongod
tcp 0 0 127.0.0.1:9001 0.0.0.0:* LISTEN 2382/java
tcp 0 0 :::111 :::* LISTEN 1794/rpcbind
tcp 0 0 :::22 :::* LISTEN 2147/sshd
tcp 0 0 :::36441 :::* LISTEN 1913/rpc.statd
udp 0 0 0.0.0.0:111 0.0.0.0:* 1794/rpcbind
udp 0 0 127.0.0.1:39287 0.0.0.0:* 3485/skype
udp 0 0 0.0.0.0:631 0.0.0.0:* 1987/cupsd
udp 0 0 0.0.0.0:3216 0.0.0.0:* 3485/skype
udp 0 0 0.0.0.0:52777 0.0.0.0:* 1913/rpc.statd
udp 0 0 0.0.0.0:817 0.0.0.0:* 1913/rpc.statd
udp 0 0 192.168.122.1:53 0.0.0.0:* 2628/dnsmasq
udp 0 0 0.0.0.0:697 0.0.0.0:* 1794/rpcbind
udp 0 0 0.0.0.0:67 0.0.0.0:* 2628/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 18609/dhclient
udp 0 0 :::111 :::* 1794/rpcbind
udp 0 0 :::697 :::* 1794/rpcbind
udp 0 0 :::47419 :::* 1913/rpc.statd "
}
}
and my map reduce code was given below
var mapfunction = function(){
var key,values;
for (var i in this.Commands) {
key = {id:this._id};
values = {commands:this.Commands};
emit(key,values);
}
}
var reducefunction = function(key,values){
var reduced = {netstat:[]};
for(var i =0 ; i< values.length;i++){
reduced.netstat = values[i].commands.netstat -tulpn;
}
return reduced;
}
db.collectioname.mapReduce(mapfunction,reducefunction,{
out: {replace:"final"}
})
When I was run this code mongoshell it shows following error
"JavaScript execution failed: map reduce failed:{
"errmsg" : "exception: JavaScript execution failed: ReferenceError: tulpn is not defined near '.netstat -tulpn; ' (line 5)",
"code" : 16722,
"ok" : 0
}
Can any one tell me why mongo map reduced not worked on key which contains spaces in two words? Any one knows how to solved this issues?
Try values[i].commands['netstat -tulpn'] instead of values[i].commands.netstat -tulpn.