mturk / svcbatch Goto Github PK
View Code? Open in Web Editor NEWRun batch files as Windows service
License: Apache License 2.0
Run batch files as Windows service
License: Apache License 2.0
In the code, where you want to filter out environment variables starting with "SVCBATCH_SERVICE_", the condition check is not correct.
the original condition:
if (_wcsnicmp(wenv[i], L"SVCBATCH_SERVICE_", 17) < 0)
I think that this would be the correct condition expression:
if (_wcsnicmp(wenv[i], L"SVCBATCH_SERVICE_", 17) != 0)
Otherwise you lose environment variables. This has been a problem for me since version 1.3.2 on one machine, and the service that was started stopped immediately, but fix and compile the source code fixed it. The code snippet in earlier versions provided a different filtered environment variable list than in newer versions without the modification
Best regards
Kristóf Nagy
hi,
we have been using svcbatch 2.0.0 as a startup mechanism for our java
application (via a *.bat file) for some time. worked quite fine.
after switching to svcbatch 2.1.2 an "interesting" behaviour emerged:
while the service started successfully, stopping the service was not so easy:
the conhost and the java processes kept being actice while the state of the service said "STOPPED".
i have to mention that the *.bat script has a peculiarity:
...
:run
java ....
if %ERRORLEVEL% geq 2 goto :run
our service offers the ability to restart itself. if triggered (by whatever means), it exits with code 2
and the service restarts.
if i start the *.bat file interactively and hit ctrl-c, the reaction is:
Batchvorgang abbrechen (J/N)?
yes, the server language is German.
svcbatch has a mechanism to write "Y" back. but our german server would like an "J"
after hex-editing svcbatch.exe (replacing the Y by J), stopping via the service manager worked fine again.
let me stress again that this behaviour has been introduced between 2.0.0 and 2.1.2 of svcbatch, everything else is the same.
Regards
Provided binary release 1.4.0 does not forward system environment variables, among others %SystemRoot%
Because of that, all executables that use sockets fail with error 10106
For example
ping localhost
produces
Ping request could not find host localhost. Please check the name and try again.
Reason is because windows cannot load msock.dll under %SystemRoot%\system32
Adding
SET SystemRoot=C:\WINDOWS
at the beginning of bat file fixes that, but then somehow log rotation gets triggered endlesly.
Build using VS 2017 forwards required system variables and also log rotation does not get triggered.
Hi,
I try to to do it with a very simple batch file that execute one sql command in a loop.
Is there any reason why it won't work ?
Thanks for this tool.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.