You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Kauppila Jared <Ja...@sentry.com> on 2021/12/23 16:20:16 UTC

[DAEMON] Updating install image on Windows

Hello,

When using 'procrun.exe' to install a service on Windows, you can specify '-Install C:/path/to/procrun.exe' to set the imagePath that the service will utilize.

I've noticed that updating a service while passing '-install' will not update that imagePath and digging into the code verifies this at https://github.com/apache/commons-daemon/blob/master/src/native/windows/apps/prunsrv/prunsrv.c#L994

In my scenario, I would like to upgrade the version of Commons Daemon I'm using and need to update that imagePath value. Is my only option to delete/install the service, or manually edit the registry? Or is there some other command to facilitate updating that value?

Would a PR be accepted to allow updating imagePath via the update command?

Thanks,

Jared Kauppila
Sr. Platform Engineer | Cloud Infrastructure
715-346-8134
Jared.Kauppila@sentry.com<mailto:Jared.Kauppila@sentry.com%0d>

This e-mail is confidential. If you are not the intended recipient, you must not disclose or use the information contained in it. If you have received this e-mail in error, please tell us immediately by return e-mail and delete the document. No recipient may use the information in this e-mail in violation of any civil or criminal statute. We disclaim all liability for any unauthorized uses of this e-mail or its contents, and accept no liability or responsibility for any damage caused by any virus transmitted with this e-mail.

Re: [DAEMON] Updating install image on Windows

Posted by Mark Thomas <ma...@apache.org>.
On 23/12/2021 16:20, Kauppila Jared wrote:
> Hello,
> 
> When using 'procrun.exe' to install a service on Windows, you can specify '-Install C:/path/to/procrun.exe' to set the imagePath that the service will utilize.
> 
> I've noticed that updating a service while passing '-install' will not update that imagePath and digging into the code verifies this at https://github.com/apache/commons-daemon/blob/master/src/native/windows/apps/prunsrv/prunsrv.c#L994

That was clearly a deliberate decision. What isn't clear is why the 
decision was made.

> In my scenario, I would like to upgrade the version of Commons Daemon I'm using and need to update that imagePath value. Is my only option to delete/install the service, or manually edit the registry? Or is there some other command to facilitate updating that value?

I don't believe there is a command to do that.

Is another option just to replace the executable with the new version?

> Would a PR be accepted to allow updating imagePath via the update command?

I don't see why not, providing that it was shown that updating the image 
path didn't cause any complications. I do wonder how a service would 
react if that was changed while the service was running.

Given that you are going to have to stop the service to update 
procrun.exe, why not stop the service, replace procrun.exe and restart 
the service instead?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org