windows deployment in 2019

19 views
Skip to first unread message

Jesús Martí­nez

unread,
Nov 3, 2019, 9:05:22 PM11/3/19
to pylons-discuss
Hi everyone.

i know there is a link for what i am going to ask (https://docs.pylonsproject.org/projects/pyramid-cookbook/en/latest/deployment/windows.html) but please bear with me.

I have a pyramid app i can launch with pserve and i want to make it a service in windows. I found that powershell now offers a tool to run .exe's as services called New-service, the instructions in the link above nowhere refer to this tool and that makes me think that maybe it is a little outdated. Can we not use the New-service cmdlet to create the service? 

In my case i created a service with this:
> New-Service -Name "gen_excel" -DisplayName "generador de excel" -Description "webapp para generador de excel" -BinaryPathName "C:/`Program Files`/generador_excel/venv/Scripts/pserve.exe C:/`Program Files`/generador_excel/production.ini"

and i get a positive response, the service is created but when i try to run it i get ERROR 1053 "service didnt respond in timely manner" or something like that. (i get response in spanish, tried to translate it for you).

between the many posibles ways to escape blankspaces and the little verbosity of the error i just cant make this work.

have any of you gone this route (creating service with New-service)? how did you make it work?

thanks. regards

Petr Blahoš

unread,
Nov 4, 2019, 6:13:06 AM11/4/19
to pylons-...@googlegroups.com
Hi, I have got a very good experience with nssm (https://nssm.cc/). 
I make a batch file that runs 
  cd where-my-production.ini-rests
  pserve production.ini
which is then run by nssm as a service.
If you insist on powershell, are the ` in your ...Name "C:/`Program Files`/genera... really 
back-ticks (or whatever they are called)? I believe there might be a problem. Try using ' and 
try quoting the whole path:
> New-Service -Name "gen_excel" -DisplayName "generador de excel" -Description "webapp para generador de excel" -BinaryPathName "'C:/Program Files/generador_excel/venv/Scripts/pserve.exe' 'C:/Program Files/generador_excel/production.ini'"

--
Petr


--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/31aa7d27-6fe1-494b-bda3-77a5c5362401%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages