[web2py] Re: Windows Service fails with 2 ports on rocket server

2013-04-06 Thread Adham Hassan
Thanks! I can see the issue you're talking about, and decided to add a 
little more to it. The command line starts gluon\widget.py, so I've copied 
some of the code from it that works and added it to winservice.py to fix 
the issue. Specifically:

self.server = main.HttpServer(
ip=options.ip,
port=options.port,
...

To:

if not options.interfaces:
(ip, port) = (options.ip, int(options.port))
else:
first_if = options.interfaces[0]
(ip, port) = first_if[0], first_if[1]
self.server = main.HttpServer(
ip=ip,
port=port,
interfaces=options.interfaces,
...

Thanks again.

On Friday, April 5, 2013 2:20:02 PM UTC-7, Niphlod wrote:

 I's say using nssm.exe will spare you some headaches.

 It seems that there are a few errors in winservice.py

 You can try to patch it.
 self.server = main.HttpServer(
 ip=options.ip,
 port=options.port,
 password=options.password,
 pid_filename=options.pid_filename,
 log_filename=options.log_filename,
 profiler_filename=options.profiler_filename,
 ssl_certificate=options.ssl_certificate,
 ssl_private_key=options.ssl_private_key,
 min_threads=options.minthreads,
 max_threads=options.maxthreads,
 server_name=options.server_name,
 request_queue_size=options.request_queue_size,
 timeout=options.timeout,
 shutdown_timeout=options.shutdown_timeout,
 path=options.folder,
 *interfaces=options.interfaces*
 )
 additions in *bold*

 and include
 ip = '127.0.0.1'
 port = 8000


 in the config file. In theory, when *interfaces* is passed it should 
 override whatever ip or port you pass




-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Windows Service fails with 2 ports on rocket server

2013-04-05 Thread Niphlod
I's say using nssm.exe will spare you some headaches.

It seems that there are a few errors in winservice.py

You can try to patch it.
self.server = main.HttpServer(
ip=options.ip,
port=options.port,
password=options.password,
pid_filename=options.pid_filename,
log_filename=options.log_filename,
profiler_filename=options.profiler_filename,
ssl_certificate=options.ssl_certificate,
ssl_private_key=options.ssl_private_key,
min_threads=options.minthreads,
max_threads=options.maxthreads,
server_name=options.server_name,
request_queue_size=options.request_queue_size,
timeout=options.timeout,
shutdown_timeout=options.shutdown_timeout,
path=options.folder,
*interfaces=options.interfaces*
)
additions in *bold*

and include
ip = '127.0.0.1'
port = 8000


in the config file. In theory, when *interfaces* is passed it should 
override whatever ip or port you pass


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Windows Service fails with 2 ports on rocket server

2013-04-05 Thread Massimo Di Pierro
Where is this?

On Friday, 5 April 2013 16:20:02 UTC-5, Niphlod wrote:

 I's say using nssm.exe will spare you some headaches.

 It seems that there are a few errors in winservice.py

 You can try to patch it.
 self.server = main.HttpServer(
 ip=options.ip,
 port=options.port,
 password=options.password,
 pid_filename=options.pid_filename,
 log_filename=options.log_filename,
 profiler_filename=options.profiler_filename,
 ssl_certificate=options.ssl_certificate,
 ssl_private_key=options.ssl_private_key,
 min_threads=options.minthreads,
 max_threads=options.maxthreads,
 server_name=options.server_name,
 request_queue_size=options.request_queue_size,
 timeout=options.timeout,
 shutdown_timeout=options.shutdown_timeout,
 path=options.folder,
 *interfaces=options.interfaces*
 )
 additions in *bold*

 and include
 ip = '127.0.0.1'
 port = 8000


 in the config file. In theory, when *interfaces* is passed it should 
 override whatever ip or port you pass




-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Windows Service fails with 2 ports on rocket server

2013-04-05 Thread Niphlod
gluon/winservice.py
However, there's a problem.
when you pass --interfaces to rocket, it overrides whatever ip,port you 
pass (reading the docs)

normally gluon.widget just discards -i and -p in favour of --interfaces

options_std.py reports interfaces AND ip AND port ... it should be cleared 
out that with this patch the interfaces always overrides ip and 
port.

PS: can we please ditch all winservice (and contrib/ related) madness in 
favour of nssm ? 
Clearly just a few are testing it, there are problems with the parameters 
passed to web2py.py -W and additionally I don't think that the code is able 
to register itself and work ok on all windows OSes.

less headaches for users, less for developers  win-win(dows) ? (no pun 
intended :P )

-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.