mtconnect / cppagent

C++ Agent toolkit - Pre-built binaries, visit: https://github.com/mtconnect/cppagent/releases Docker images available at https://hub.docker.com/repositories/mtconnect
http://mtcup.org/
Apache License 2.0
143 stars 91 forks source link

Cannot start service when cfg file has different name than default #458

Closed dwvwitkowski1 closed 6 months ago

dwvwitkowski1 commented 6 months ago

Hello, I found the case where the behavior might be followup to the one mentioned in another thread regarding the service issue:

The agent appears to install as a service but fails with a 1067 error. Worked with 1.8.0.3 but later versions than that.

Originally posted by @markjmorrison in https://github.com/mtconnect/cppagent/issues/258#issuecomment-1505849787

Steps to reproduce using the demo configuration (tested on both 2.0.0.11 and 2.3.0.9):

  1. rename the agent.cfg file to any other name (e.g. test.cfg).
  2. using consolle in admin mode install the service: .\agent.exe install .\test.cfg.
  3. find MTConnect Agent in the Services - it throws a 1067 error when trying to start.

Additional notes:

wsobel commented 6 months ago

Thanks a lot for reporting. I’ll take a look.

markjmorrison commented 6 months ago

Hello:

I can confirm that specifying a ServiceName parameter allows the service to start successfully. The version I tested was 2.3.0.7. Thank you for finding this.

Mark

On Fri, 24 May 2024 03:42:03 -0700, dwitkowski @.***> wrote:    

Hello, I found the case where the behavior might be followup to the one mentioned in another thread regarding the service issue:

The agent appears to install as a service but fails with a 1067 error. Worked with 1.8.0.3 but later versions than that.

Originally posted by @markjmorrison in #258 (comment)

Steps to reproduce using the demo configuration (tested on both 2.0.0.11 and 2.3.0.9):

rename the agent.cfg file to any other name (e.g. test.cfg).
using consolle in admin mode install the service: .\agent.exe install .\test.cfg.
find MTConnect Agent in the Services - it throws a 1067 error when trying to start.

Additional notes:

the installation is completing successfully.
setting ServiceName in test.cfg works and the service name changes using this value.
adding agent.cfg to the same folder as test.cfg will cause the service to start. It will use agent.cfg instead of the file that was passed during service installation.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

wsobel commented 6 months ago

I added a fix to the current pull request associated with this.

wsobel commented 6 months ago

There are still some startup issues with the service. Windows services are tricky to debug

wsobel commented 6 months ago

Fixed the problem with option parsing.

wsobel commented 6 months ago

should work now.

markjmorrison commented 5 months ago

Thank you for resolving this issue.

Mark  

On Tue, 04 Jun 2024 11:03:22 -0700, William Sobel @.***> wrote:    

Closed #458 as completed via #459.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>