"Hello world" web app and Glassfish crash: address already in use: 8080 - linux

From Netbeans 6.9.1 I chose to include Glassfish 3 on install. I then created a new web application and selected JSF 2.0, so Netbeans created a "hello world" type app to start from. However, running it brings up errors, but it's better now that I've modified glassfish a bit. However, why is there still a database problem when I'm not even using a database?
now I'm getting:
glassfish:
Mar 2, 2011 8:49:36 PM com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on Felix platform
Welcome to Felix
================
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Starting Grizzly Framework 1.9.18-o - Wed Mar 02 20:50:51 PST 2011
INFO: Starting Grizzly Framework 1.9.18-o - Wed Mar 02 20:50:51 PST 2011
INFO: Grizzly Framework 1.9.18-o started in: 1122ms listening on port 7676
INFO: Grizzly Framework 1.9.18-o started in: 1606ms listening on port 8181
INFO: Grizzly Framework 1.9.18-o started in: 1821ms listening on port 8081
INFO: Grizzly Framework 1.9.18-o started in: 1491ms listening on port 3700
INFO: Grizzly Framework 1.9.18-o started in: 1537ms listening on port 4848
INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time : Felix(67028ms) startup services(17874ms) total(84902ms)
INFO: Binding RMI port to *:8686
INFO: JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://tleilax.servebeer.com:8686/jndi/rmi://tleilax.servebeer.com:8686/jmxrmi
INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Grizzly Framework 1.9.18-o started in: 266ms listening on port 8081
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /home/thufir/glassfish-3.0.1/glassfish/modules/autostart, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /tmp/fileinstall-8585686048027063971, felix.fileinstall.filter = null}
INFO: Installed /home/thufir/glassfish-3.0.1/glassfish/modules/autostart/osgi-web-container.jar
INFO: Installed /home/thufir/glassfish-3.0.1/glassfish/modules/autostart/org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: Installed /home/thufir/glassfish-3.0.1/glassfish/modules/autostart/org.apache.felix.scr.jar
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /home/thufir/glassfish-3.0.1/glassfish/domains/domain1/autodeploy/bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /tmp/fileinstall-3996754497384347726, felix.fileinstall.filter = null}
INFO: Started bundle: file:/home/thufir/glassfish-3.0.1/glassfish/modules/autostart/osgi-web-container.jar
INFO: Started bundle: file:/home/thufir/glassfish-3.0.1/glassfish/modules/autostart/org.apache.felix.scr.jar
INFO: SEC1002: Security Manager is OFF.
INFO: Security startup service called
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm certificate of classtype com.sun.enterprise.security.auth.realm.certificate.CertificateRealm successfully created.
INFO: Security service(s) started successfully....
INFO: Total number of available updates : 59
INFO: Available updates :
glassfish-full-incorporation 3.1,0-43:20110215T074016Z Tue Feb 15 07:40:16 PST 2011
glassfish-web-incorporation 3.1,0-43:20110215T074014Z Tue Feb 15 07:40:14 PST 2011
glassfish-web-l10n 3.1,0-41.1:20110213T154415Z Sun Feb 13 15:44:15 PST 2011
glassfish-ejb-lite-l10n 3.1,0-41.1:20110213T154350Z Sun Feb 13 15:43:50 PST 2011
pkg-java 1.122,0-52.2817:20110218T204119Z Fri Feb 18 20:41:19 PST 2011
glassfish-ejb-l10n 3.1,0-41.1:20110213T154345Z Sun Feb 13 15:43:45 PST 2011
glassfish-gui-l10n 3.1,0-41.1:20110213T154326Z Sun Feb 13 15:43:26 PST 2011
glassfish-nucleus-l10n 3.1,0-41.1:20110213T154338Z Sun Feb 13 15:43:38 PST 2011
javadb-core 10.6.2.1,0-1:20101213T185842Z Mon Dec 13 18:58:42 PST 2010
javadb-client 10.6.2.1,0-1:20101213T185835Z Mon Dec 13 18:58:35 PST 2010
jersey 1.5,0-1.0:20110215T072802Z Tue Feb 15 07:28:02 PST 2011
mq-core 4.5,0-29.2:20110210T074434Z Thu Feb 10 07:44:34 PST 2011
glassfish-jdbc-l10n 3.1,0-41.1:20110213T154422Z Sun Feb 13 15:44:22 PST 2011
glassfish-full-profile 3.1,0-43:20110215T074029Z Tue Feb 15 07:40:29 PST 2011
glassfish-upgrade-l10n 3.1,0-41.1:20110213T154456Z Sun Feb 13 15:44:56 PST 2011
glassfish-jca-l10n 3.1,0-41.1:20110213T154405Z Sun Feb 13 15:44:05 PST 2011
javadb-common 10.6.2.1,0-1:20101213T185828Z Mon Dec 13 18:58:28 PST 2010
glassfish-common-full-l10n 3.1,0-41.1:20110213T154354Z Sun Feb 13 15:43:54 PST 2011
glassfish-web-profile 3.1,0-43:20110215T074022Z Tue Feb 15 07:40:22 PST 2011
glassfish-common-l10n 3.1,0-41.1:20110213T154451Z Sun Feb 13 15:44:51 PST 2011
glassfish-jts-l10n 3.1,0-41.1:20110213T154359Z Sun Feb 13 15:43:59 PST 2011
glassfish-jms-l10n 3.1,0-41.1:20110213T154409Z Sun Feb 13 15:44:09 PST 2011
glassfish-corba 3.1.0,0-27:20110215T071130Z Tue Feb 15 07:11:30 PST 2011
glassfish-jms 3.1,0-43:20110215T072339Z Tue Feb 15 07:23:39 PST 2011
mq-locale 4.5,0-29.2:20110210T074528Z Thu Feb 10 07:45:28 PST 2011
mq-server 4.5,0-29.2:20110210T074445Z Thu Feb 10 07:44:45 PST 2011
mq-bin-sh 4.5,0-29.2:20110210T074442Z Thu Feb 10 07:44:42 PST 2011
metro 2.1,0-30:20110215T073257Z Tue Feb 15 07:32:57 PST 2011
glassfish-cmp 3.1,0-43:20110215T072715Z Tue Feb 15 07:27:15 PST 2011
mq-bin-exe 4.5,0-29.2:20110210T105419Z Thu Feb 10 10:54:19 PST 2011
glassfish-ejb 3.1,0-43:20110215T072446Z Tue Feb 15 07:24:46 PST 2011
glassfish-common-full 3.1,0-43:20110215T072130Z Tue Feb 15 07:21:30 PST 2011
glassfish-appclient 3.1,0-43:20110215T073837Z Tue Feb 15 07:38:37 PST 2011
mq-config-gf 4.5,0-29.2:20110210T074525Z Thu Feb 10 07:45:25 PST 2011
glassfish-grizzly-full 1.9.31,0-1:20110215T070725Z Tue Feb 15 07:07:25 PST 2011
glassfish-management 3.1,0-43:20110215T071037Z Tue Feb 15 07:10:37 PST 2011
glassfish-hk2 3.1,0-43:20110215T070538Z Tue Feb 15 07:05:38 PST 2011
glassfish-upgrade 3.1,0-43:20110215T071009Z Tue Feb 15 07:10:09 PST 2011
glassfish-jts 3.1,0-43:20110215T072233Z Tue Feb 15 07:22:33 PST 2011
glassfish-corba-base 3.1.0,0-27:20110215T070738Z Tue Feb 15 07:07:38 PST 2011
glassfish-javahelp 2.0.2,0-1:20110215T071001Z Tue Feb 15 07:10:01 PST 2011
glassfish-scripting 3.1,0-41:20110208T202810Z Tue Feb 08 20:28:10 PST 2011
glassfish-nucleus 3.1,0-43:20110215T070659Z Tue Feb 15 07:06:59 PST 2011
glassfish-jpa 3.1,0-43:20110215T071106Z Tue Feb 15 07:11:06 PST 2011
glassfish-ejb-lite 3.1,0-43:20110215T072030Z Tue Feb 15 07:20:30 PST 2011
glassfish-jcdi 3.1,0-43:20110215T072735Z Tue Feb 15 07:27:35 PST 2011
glassfish-jdbc 3.1,0-43:20110215T071818Z Tue Feb 15 07:18:18 PST 2011
glassfish-common 3.1,0-43:20110215T074007Z Tue Feb 15 07:40:07 PST 2011
glassfish-jsf 2.1.0,0-11:20110215T071155Z Tue Feb 15 07:11:55 PST 2011
glassfish-gui 3.1,0-43:20110215T071924Z Tue Feb 15 07:19:24 PST 2011
glassfish-registration 3.1,0-43:20110215T071019Z Tue Feb 15 07:10:19 PST 2011
felix 3.0.8,0-0:20110215T070355Z Tue Feb 15 07:03:55 PST 2011
glassfish-grizzly 1.9.31,0-1:20110215T070555Z Tue Feb 15 07:05:55 PST 2011
glassfish-web 3.1,0-43:20110215T071324Z Tue Feb 15 07:13:24 PST 2011
glassfish-jta 3.1,0-43:20110215T071139Z Tue Feb 15 07:11:39 PST 2011
glassfish-jca 3.1,0-43:20110215T071053Z Tue Feb 15 07:10:53 PST 2011
glassfish-cluster 3.1,0-43:20110215T070945Z Tue Feb 15 07:09:45 PST 2011
shoal 1.5.29,0-0:20110215T070911Z Tue Feb 15 07:09:11 PST 2011
glassfish-ha 3.1,0-43:20110215T070954Z Tue Feb 15 07:09:54 PST 2011
INFO: Created HTTP listener http-listener-1 on port 8081
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Created HTTP listener admin-listener on port 4848
INFO: Created virtual server server
INFO: Created virtual server __asadmin
INFO: Virtual server server loaded system default web module
INFO: Initializing Mojarra 2.0.2 (FCS b10) for context '/WebApplication1'
INFO: Loading application WebApplication1 at /WebApplication1
INFO: WebApplication1 was successfully deployed in 245,397 milliseconds.
Java DB Database Process:
2011-03-03 04:49:35.249 GMT : Security manager installed using the Basic server security policy.
2011-03-03 04:49:48.584 GMT : Could not listen on port 1527 on host localhost:
java.net.BindException: Address already in use
WebApplication1 (run):
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Starting GlassFish Server 3
GlassFish Server 3 is running.
In-place deployment at /home/thufir/NetBeansProjects/WebApplication1/build/web
Initializing...
run-deploy:
Browsing: http://localhost:8080/WebApplication1/
run-display-browser:
run:
BUILD SUCCESSFUL (total time: 15 minutes 35 seconds)
However, that "database" still on the wrong port for some reason(?).
I modified one domain.xml, but there's also one in template:
thufir#tleilax:~$
thufir#tleilax:~$ nl /home/thufir/glassfish-3.0.1/glassfish/domains/domain1/config/domain.xml | grep 8081
189 <network-listener port="8081" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool" />
thufir#tleilax:~$
thufir#tleilax:~$
thufir#tleilax:~$ ll /home/thufir/glassfish-3.0.1/glassfish/lib/templates/domain.xml
-rw-rw-r-- 1 thufir thufir 12804 2010-06-08 15:37 /home/thufir/glassfish-3.0.1/glassfish/lib/templates/domain.xml
thufir#tleilax:~$
However, glassfish now seems to be running ok, although I would prefer it on 8080 as it would be by default. I just don't understand why there's a database connection to, apparently, no database -- certainly not one I selected.
thufir#tleilax:~$
thufir#tleilax:~$ sudo lsof -i :1527
[sudo] password for thufir:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 4757 thufir 27u IPv6 46934 0t0 TCP localhost.localdomain:1527 (LISTEN)
thufir#tleilax:~$
thufir#tleilax:~$
thufir#tleilax:~$
thufir#tleilax:~$ nl /home/thufir/glassfish-3.0.1/glassfish/domains/domain1/config/domain.xml | grep 8081
189 <network-listener port="8081" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool" />
thufir#tleilax:~$
thufir#tleilax:~$ ll /home/thufir/glassfish-3.0.1/glassfish/lib/templates/domain.xml
-rw-rw-r-- 1 thufir thufir 12804 2010-06-08 15:37 /home/thufir/glassfish-3.0.1/glassfish/lib/templates/domain.xml
thufir#tleilax:~$
thufir#tleilax:~$ sudo lsof -i :1527
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 4757 thufir 27u IPv6 46934 0t0 TCP localhost.localdomain:1527 (LISTEN)
thufir#tleilax:~$
thufir#tleilax:~$

It means the port 8080 has already been used by other process in your system.
try to run sudo lsof -i :8080 to see what process/service runs on that port and terminate it.
Another solution is to completely change the port number.
I had this kind of problem last time when installing Netbeans for second time a year ago but as far as I remember I had v2 glassfish and v3 beta (2 years ago).
What I did is to change the port number. Have a look at domain.xml (probably) and change the port number 8080 to something else (unoccupied port).

Related

NodeJS SSH2 module data returned in inconsistent format

I am using the ssh2 node module to connect via ssh to a server. After which I run a command to list print ques and put them into an array, the command is lpstat -o.
When I use putty and ssh into a server and run this command, I get data returned like this:
LABEL008-2287 printeng 1024 Tue 08 Oct 2019 08:30:20 AM CDT
LABEL008-2288 printeng 1024 Tue 08 Oct 2019 08:30:20 AM CDT
LABEL002-2292 printeng 1024 Tue 08 Oct 2019 10:05:11 AM CDT
LABEL002-2293 printeng 1024 Tue 08 Oct 2019 10:05:11 AM CDT
However, when I use nodejs and run the command the data comes at times comes inconsistently (cut off) like this:
LABEL008-2287 printeng 1024 Tue Oct 8 08:30:20 2019
LABEL008-2288 printeng 1024 Tue Oct 8 08:30:20 2019
LABEL002-2294 printeng 1024 Tue Oct 8 10:05:12 2019
LABEL002-2298 printeng 1024 Tue Oct 8 10:05:12
2019
LABEL008-2299 printeng 1024 Tue Oct 8 10:05:15 2019
LABEL008-2300 printeng 1024 Tue Oct 8 10:05:17 2019
This is troublesome as I am needing to split the data by new line '\n\' and put it into an array which I am achieving like so:
}).on('data', function(data) {
const myArray = data.toString().split('\n');
I am not sure if this is an issue or limitation with the node module itself or if I am missing an option or configuration with how the data stream should be handled.

Connect to an OpenVPN server from an Azure Cloud Service client

I have a few machines on my office that can connect to a server that uses OpenVPN (UDP), given its .ovpn file. I'm also able to connect to that same server from my personal computer, which is in another network. I'm also able to connect to that server from a clean Azure VM running Windows Server 2012, that I just created to test this. But I haven't been able to connect to that same server (same .ovpn file) from a machine that is hosting an Azure Cloud Service.
The Azure Cloud Service was created with the default network configurations, InputEndpoints on ports 443(TCP) and 1194(UDP), and I added firewall exceptions that allowed any connections to UDP and TCP ports.
Yet, when I try to connect to the OpenVPN server from the Azure VM I get the message:
TLS Error: TLS key negotiation failed to occur within 60 seconds
(check your network connectivity)
Is there any configuration other than the firewall exceptions that I should add to the cloud service so that it will enable me to connect to an OpenVPN server that uses UDP?
Below is the full log:
PS C:\config\config> openvpn .\client.ovpn
Fri Jul 22 15:32:55 2016 Option 'nobind' in .\client.ovpn:46 is ignored by previous <connection> blocks
Fri Jul 22 15:32:55 2016 us=764333 Current Parameter Settings:
Fri Jul 22 15:32:55 2016 us=764333 config = '.\client.ovpn'
Fri Jul 22 15:32:55 2016 us=764333 mode = 0
Fri Jul 22 15:32:55 2016 us=764333 show_ciphers = DISABLED
Fri Jul 22 15:32:55 2016 us=764333 show_digests = DISABLED
Fri Jul 22 15:32:55 2016 us=764333 show_engines = DISABLED
Fri Jul 22 15:32:55 2016 us=764333 genkey = DISABLED
Fri Jul 22 15:32:55 2016 us=764333 key_pass_file = '[UNDEF]'
Fri Jul 22 15:32:55 2016 us=764333 show_tls_ciphers = DISABLED
Fri Jul 22 15:32:55 2016 us=764333 Connection profiles [default]:
Fri Jul 22 15:32:55 2016 us=764333 proto = udp
Fri Jul 22 15:32:55 2016 us=764333 local = '[UNDEF]'
Fri Jul 22 15:32:55 2016 us=764333 local_port = 1194
Fri Jul 22 15:32:55 2016 us=764333 remote = '[UNDEF]'
Fri Jul 22 15:32:55 2016 us=764333 remote_port = 1194
Fri Jul 22 15:32:55 2016 us=764333 remote_float = DISABLED
Fri Jul 22 15:32:55 2016 us=764333 bind_defined = DISABLED
Fri Jul 22 15:32:55 2016 us=795589 bind_local = DISABLED
Fri Jul 22 15:32:55 2016 us=795589 connect_retry_seconds = 5
Fri Jul 22 15:32:55 2016 us=795589 connect_timeout = 10
Fri Jul 22 15:32:55 2016 us=795589 NOTE: --mute triggered...
Fri Jul 22 15:32:55 2016 us=795589 618 variation(s) on previous 20 message(s) suppressed by --mute
Fri Jul 22 15:32:55 2016 us=795589 OpenVPN 2.3.10 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [IPv6] built on Jan
4 2016
Fri Jul 22 15:32:55 2016 us=795589 Windows version 6.2 (Windows 8 or greater)
Fri Jul 22 15:32:55 2016 us=795589 library versions: OpenSSL 1.0.1q 3 Dec 2015, LZO 2.09
Fri Jul 22 15:32:55 2016 us=983250 Control Channel Authentication: using 'engSimaTef.key' as a OpenVPN static key file
Fri Jul 22 15:32:56 2016 us=3179 Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC a
uthentication
Fri Jul 22 15:32:56 2016 us=3179 Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC a
uthentication
Fri Jul 22 15:32:56 2016 us=14347 LZO compression initialized
Fri Jul 22 15:32:56 2016 us=14347 Control Channel MTU parms [ L:1602 D:1140 EF:110 EB:0 ET:0 EL:3 ]
Fri Jul 22 15:32:56 2016 us=14347 Socket Buffers: R=[65536->65536] S=[65536->65536]
Fri Jul 22 15:32:56 2016 us=168985 Data Channel MTU parms [ L:1602 D:1450 EF:102 EB:143 ET:0 EL:3 AF:3/1 ]
Fri Jul 22 15:32:56 2016 us=168985 Local Options String: 'V4,dev-type tun,link-mtu 1602,tun-mtu 1500,proto UDPv4,comp-lz
o,keydir 1,cipher AES-256-CBC,auth SHA512,keysize 256,tls-auth,key-method 2,tls-client'
Fri Jul 22 15:32:56 2016 us=168985 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1602,tun-mtu 1500,proto UDP
v4,comp-lzo,keydir 0,cipher AES-256-CBC,auth SHA512,keysize 256,tls-auth,key-method 2,tls-server'
Fri Jul 22 15:32:56 2016 us=168985 Local Options hash (VER=V4): 'a5d50645'
Fri Jul 22 15:32:56 2016 us=168985 Expected Remote Options hash (VER=V4): '14d315e7'
Fri Jul 22 15:32:56 2016 us=168985 UDPv4 link local: [undef]
Fri Jul 22 15:32:56 2016 us=184587 UDPv4 link remote: [AF_INET][[SOME_HIDDEN_IP]]:10055
Fri Jul 22 15:32:56 2016 us=184587 UDPv4 WRITE [86] to [AF_INET][[SOME_HIDDEN_IP]]:10055: P_CONTROL_HARD_RESET_CLIENT_V2 ki
d=0 pid=[ #1 ] [ ] pid=0 DATA len=0
Fri Jul 22 15:32:56 2016 us=184587 UDPv4 READ [0] from [undef]: DATA UNDEF len=-1
Fri Jul 22 15:32:58 2016 us=558842 UDPv4 WRITE [86] to [AF_INET][[SOME_HIDDEN_IP]]:10055: P_CONTROL_HARD_RESET_CLIENT_V2 ki
d=0 pid=[ #2 ] [ ] pid=0 DATA len=0
Fri Jul 22 15:33:02 2016 us=785774 UDPv4 WRITE [86] to [AF_INET][[SOME_HIDDEN_IP]]:10055: P_CONTROL_HARD_RESET_CLIENT_V2 ki
d=0 pid=[ #3 ] [ ] pid=0 DATA len=0
Fri Jul 22 15:33:11 2016 us=85405 UDPv4 WRITE [86] to [AF_INET][[SOME_HIDDEN_IP]]:10055: P_CONTROL_HARD_RESET_CLIENT_V2 kid
=0 pid=[ #4 ] [ ] pid=0 DATA len=0
Fri Jul 22 15:33:27 2016 us=873602 UDPv4 WRITE [86] to [AF_INET][[SOME_HIDDEN_IP]]:10055: P_CONTROL_HARD_RESET_CLIENT_V2 ki
d=0 pid=[ #5 ] [ ] pid=0 DATA len=0
Fri Jul 22 15:33:57 2016 us=129612 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network
connectivity)
Fri Jul 22 15:33:57 2016 us=129612 TLS Error: TLS handshake failed
Fri Jul 22 15:33:57 2016 us=129612 TCP/UDP: Closing socket
Fri Jul 22 15:33:57 2016 us=129612 SIGUSR1[soft,tls-error] received, process restarting
Fri Jul 22 15:33:57 2016 us=129612 Restart pause, 2 second(s)
Fri Jul 22 15:33:59 2016 us=148186 Re-using SSL/TLS context
Fri Jul 22 15:33:59 2016 us=148186 LZO compression initialized
...
The error is telling that OpenVPN tried to connect to the host
WRITE [86] to [AF_INET][[SOME_HIDDEN_IP]]:10055: P_CONTROL_HARD_RESET_CLIENT_V2 ki d=0 pid=[ #1 ] [ ] pid=0 DATA len=0
but has not recieved any answer:
UDPv4 READ [0] from [undef]: DATA UNDEF len=-1
After the trial of 5 times the client stops to try to connect:
TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
The process stops in the first activity waiting for the reply:
(source: staticworld.net)
In those cases it is likely to have a connectivity problem. In the past I had the same problem once the problem was not enabled the required ports. (Take a look at both outgoing and incoming firevall rules.) An another problem could be that the server is not running or is not reachable.
TLDR: check out (VPN) service availability and firewall rules. In extreme cases there could be routing problems at the ISP (happend to a friend of mine) in this case you should report the problem to them and they will fix it.

Openvpn linux connection reset, restarting [0] [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
This works perfectly fine under windows but fails on my ubuntu laptop
Does anyone have any insight as to why this is?
openvpn output
Thu Dec 31 13:49:42 2015 OpenVPN 2.3.2 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Apr 13 2015
Thu Dec 31 13:49:42 2015 WARNING: file 'tom.key' is group or others accessible
Thu Dec 31 13:49:42 2015 Socket Buffers: R=[87380->131072] S=[16384->131072]
Thu Dec 31 13:49:42 2015 Attempting to establish TCP connection with [AF_INET]120.136.49.81:47 [nonblock]
.........
Thu Dec 31 13:49:46 2015 OPTIONS IMPORT: timers and/or timeouts modified
Thu Dec 31 13:49:46 2015 OPTIONS IMPORT: --ifconfig/up options modified
Thu Dec 31 13:49:46 2015 OPTIONS IMPORT: route options modified
Thu Dec 31 13:49:46 2015 OPTIONS IMPORT: route-related options modified
Thu Dec 31 13:49:46 2015 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Thu Dec 31 13:49:46 2015 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 IFACE=wlan0 HWADDR=88:53:2e:a5:8b:1f
Thu Dec 31 13:49:46 2015 TUN/TAP device tap0 opened
Thu Dec 31 13:49:46 2015 TUN/TAP TX queue length set to 100
Thu Dec 31 13:49:46 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Thu Dec 31 13:49:46 2015 /sbin/ip link set dev tap0 up mtu 1500
Thu Dec 31 13:49:46 2015 /sbin/ip addr add dev tap0 10.8.0.61/8 broadcast 10.255.255.255
Thu Dec 31 13:49:46 2015 /sbin/ip route add 120.136.49.81/32 via 192.168.1.1
RTNETLINK answers: File exists
Thu Dec 31 13:49:46 2015 ERROR: Linux route add command failed: external program exited with error status: 2
Thu Dec 31 13:49:46 2015 /sbin/ip route add 0.0.0.0/1 via 10.1.4.10
Thu Dec 31 13:49:46 2015 /sbin/ip route add 128.0.0.0/1 via 10.1.4.10
Thu Dec 31 13:49:46 2015 /sbin/ip route add 10.0.0.0/8 via 10.1.4.10
RTNETLINK answers: File exists
Thu Dec 31 13:49:46 2015 ERROR: Linux route add command failed: external program exited with error status: 2
Thu Dec 31 13:49:46 2015 Initialization Sequence Completed
Thu Dec 31 13:50:01 2015 Connection reset, restarting [0]
Thu Dec 31 13:50:01 2015 SIGUSR1[soft,connection-reset] received, process restarting
Thu Dec 31 13:50:01 2015 Restart pause, 5 second(s)
At this point it enters an infinite loop of reconnects and disconnects where the connection is active for about 3 seconds before the disconnect
tom.ovpn contents:
client
dev tap
proto tcp
remote xxxxxxxxxxxxxxx 47
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert tom.crt
key tom.key
ns-cert-type server
comp-lzo
verb 3
I found the issue. A silly mistake on my part.
I needed to open the firewall on port 47
sauce:
http://www.sparklabs.com/forum/viewtopic.php?f=3&t=1631

Live streaming on azure with FMLE

I am trying to stream to the new azure live channel.
I have followed the guide on http://azure.microsoft.com/blog/2014/09/18/azure-media-services-rtmp-support-and-live-encoders/
this is my FMLE setup: http://i.stack.imgur.com/U8rlk.png
but for some reason I am getting disconnected by the azure service. I am using Flash Media Live encoder 3.2 and this is what the log looks like:
Thu Oct 09 2014 16:33:30 : Video Encoding Started
Thu Oct 09 2014 16:33:39 : Primary - Network Status: NetConnection.Connect.Closed status
Thu Oct 09 2014 16:33:45 : Primary - Disconnected
Thu Oct 09 2014 16:33:48 : Primary - Re-establishing connection, attempt 1
Thu Oct 09 2014 16:33:48 : Primary - Reconnected
Thu Oct 09 2014 16:33:48 : Primary - Network Command: onBWDone
Thu Oct 09 2014 16:33:48 : Primary - Stream[mystream9] Status: Success
Thu Oct 09 2014 16:33:48 : Primary - Stream[mystream9] Status: NetStream.Publish.Start
Thu Oct 09 2014 16:33:56 : Primary - Network Status: NetConnection.Connect.Closed status
Thu Oct 09 2014 16:33:58 : Video Encoding Stopped
Thu Oct 09 2014 16:33:58 : Session Stopped
Thu Oct 09 2014 16:34:01 : Primary - Disconnected
Thu Oct 09 2014 16:34:01 : Audio source does not support the selected sample rate and/or channels. Re-sampling the audio to desired setting.
Thu Oct 09 2014 16:34:02 : Primary - Re-establishing connection, attempt 1
Thu Oct 09 2014 16:34:02 : Primary - Reconnected
Thu Oct 09 2014 16:34:05 : Primary - Network Status: NetConnection.Connect.Closed status
Thu Oct 09 2014 16:34:05 : Primary - Disconnected
Edit:
Oh well I decided not to go for azure live streaming. Reasons are many. They let you only output to mpeg-dash which frankly is not ready for the world as of now. There are few players who support that out of box. Because of the smooth streaming crap from microsoft, we the encoders, are forced into limiting our encoding options. Alot of encoding software today dont have all the option that is required to stream such as frame alignment, grouping of pictures etc. Its kinda sad that I can stream with h264 but not x264 which is opensource and better.

Pass private key password to openvpn command directly in Ubuntu 10.10 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I tried the method with different parameter
I have password.
Here below password is mypassword
1)
root$ echo mypassword || openvpn client.conf.ovpn
the result was display:
mypassword
2)
root$ openvpn client.warriors.conf.ovpn || echo mypassword
the result was display:
Thu Jun 28 00:00:00 2012 us=757575 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Enter Private Key Password:
(still need to enter password manualy )
I don't want to have to enter the password manually. How can I achieve this?
3)
DUDE
After running the script it exit out with following:
Fri Jun 29 11:56:59 2012 us=707916 cf_max = 0
Fri Jun 29 11:56:59 2012 us=707925 cf_per = 0
Fri Jun 29 11:56:59 2012 us=707934 max_clients = 1024
Fri Jun 29 11:56:59 2012 us=707944 max_routes_per_client = 256
Fri Jun 29 11:56:59 2012 us=707953 auth_user_pass_verify_script = '[UNDEF]'
Fri Jun 29 11:56:59 2012 us=707963 auth_user_pass_verify_script_via_file = DISABLED
Fri Jun 29 11:56:59 2012 us=707973 ssl_flags = 0
Fri Jun 29 11:56:59 2012 us=707982 port_share_host = '[UNDEF]'
Fri Jun 29 11:56:59 2012 us=707992 port_share_port = 0
Fri Jun 29 11:56:59 2012 us=708001 client = ENABLED
Fri Jun 29 11:56:59 2012 us=708010 pull = ENABLED
Fri Jun 29 11:56:59 2012 us=708020 auth_user_pass_file = '[UNDEF]'
Fri Jun 29 11:56:59 2012 us=708032 OpenVPN 2.1.0 i686-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [MH] [PF_INET6] [eurephia] built on Jul 12 2010
Fri Jun 29 11:56:59 2012 us=708131 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Enter Private Key Password:
Fri Jun 29 11:56:59 2012 us=726649 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Fri Jun 29 11:56:59 2012 us=726805 WARNING: file 'client-team-20110222.key' is group or others accessible
Fri Jun 29 11:56:59 2012 us=727136 /usr/bin/openssl-vulnkey -q -b 1024 -m <modulus omitted>
Fri Jun 29 11:56:59 2012 us=875611 Control Channel MTU parms [ L:1543 D:140 EF:40 EB:0 ET:0 EL:0 ]
Fri Jun 29 11:56:59 2012 us=876742 Data Channel MTU parms [ L:1543 D:1450 EF:43 EB:4 ET:0 EL:0 ]
Fri Jun 29 11:56:59 2012 us=876777 Local Options String: 'V4,dev-type tun,link-mtu 1543,tun-mtu 1500,proto TCPv4_CLIENT,cipher BF-CBC,auth SHA1,keysize 128,key-method 2,tls-client'
Fri Jun 29 11:56:59 2012 us=876788 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1543,tun-mtu 1500,proto TCPv4_SERVER,cipher BF-CBC,auth SHA1,keysize 128,key-method 2,tls-server'
Fri Jun 29 11:56:59 2012 us=876810 Local Options hash (VER=V4): 'd902a8f8'
Fri Jun 29 11:56:59 2012 us=876825 Expected Remote Options hash (VER=V4): '7e078940'
Fri Jun 29 11:56:59 2012 us=877124 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Fri Jun 29 11:56:59 2012 us=877145 Attempting to establish TCP connection with [AF_INET]89.105.130.193:444 [nonblock]
Fri Jun 29 11:57:00 2012 us=877280 TCP connection established with [AF_INET]89.105.130.193:444
Fri Jun 29 11:57:00 2012 us=877337 Socket Buffers: R=[87380->131072] S=[16384->131072]
Fri Jun 29 11:57:00 2012 us=877353 TCPv4_CLIENT link local: [undef]
Fri Jun 29 11:57:00 2012 us=877364 TCPv4_CLIENT link remote: [AF_INET]89.105.130.193:444
Fri Jun 29 11:57:00 2012 us=877568 TLS: Initial packet from [AF_INET]89.105.130.193:444, sid=c5d843bc e9f3e6ab
Fri Jun 29 11:57:04 2012 us=105788 VERIFY OK: depth=1, /C=IE/ST=NA/L=DUB/O=ABC.OpenVPN/OU=server-terminus/CN=terminus/emailAddress=ops#abc.com
Fri Jun 29 11:57:04 2012 us=106189 VERIFY OK: nsCertType=SERVER
Fri Jun 29 11:57:04 2012 us=106202 VERIFY OK: depth=0, /C=IE/ST=NA/O=abc.OpenVPN/OU=server-terminus/CN=terminus/emailAddress=ops#abc.com
root#bond$
exit in this way is it normal.
In my openvpn.conf:
...
askpass /etc/openvpn/jdoe.pass <<< new line here
ca /etc/openvpn/jdoe_ca.crt
cert /etc/openvpn/jdoe.crt
key /etc/openvpn/jdoe.key
...
The file /etc/openvpn/jdoe.pass just contains the password.
You can chmod this file to 600.
This method save my life... ;-)
Ubuntu 12.04.4 LTS
OpenVPN 2.2.1 x86_64-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Mar 13 2014
How about storing it into a file and using --askpass /your/file? --askpass option was added in OpenVPN version 2.0-beta20, Maverick has version 2.1.0-3ubuntu1.
Try a shell script such as:
#!/usr/bin/expect -f
spawn openvpn client.warriors.conf.open
match_max 100000
expect "*?assword:*"
send -- "mypassword"
send -- "\r"
expect eof
You'll need to chmod +x this, you can also set it as an environment variable so you don't have to type out the directory.
Looks like they got this script to work: https://unix.stackexchange.com/questions/9055/establish-openvpn-tunnel-in-bash-script
I think you just swipe | and || operator.
| plug standard output o the previous command to standard input of the next command.
|| launch second command only if first command fail (exit code != 0).
this command should work.
root$ echo mypassword | openvpn client.conf.ovpn

Resources