[ https://issues.apache.org/jira/browse/DAEMON-441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17529145#comment-17529145 ]
Brian Andle commented on DAEMON-441: ------------------------------------ I was able to test the 64bit version of the 1.3.1 dev build on both Win 10 and Win 2016. Win 10. No LogPath. I tested trying to install a second time just to see what would happen. {code:java} C:\Temp>prunsrv.exe //IS/MyService --Startup=auto --Description="My Service" --DisplayName="My Service" [2022-04-27 18:03:45] [warn] [19764] Failed to grant service user 'NT AUTHORITY\LocalService' write permissions to log path '<default>' due to error '19' C:\Temp>echo %ERRORLEVEL% 0 C:\Temp>prunsrv.exe //IS/MyService --Startup=auto --Description="My Service" --DisplayName="My Service" [2022-04-27 18:03:26] [error] [13632] The specified service already exists. [2022-04-27 18:03:26] [error] [13632] Failed installing service 'MyService'. [2022-04-27 18:03:26] [error] [13632] Apache Commons Daemon procrun failed with exit value: 8 (failed to install service).Failed to install service. C:\Temp>echo %ERRORLEVEL% 8 C:\Temp>sc delete MyService [SC] DeleteService SUCCESS {code} Win 10. LogPath defined {code:java} C:\Temp>prunsrv.exe //IS/MyService2 --Startup=auto --Description="My Service" --DisplayName="My Service" --LogPath=C:\Temp C:\Temp>echo %ERRORLEVEL% 0 {code} Windows 2016: {code:java} Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. All rights reserved. C:\Windows\system32>cd\ C:\>cd tempC:\Temp>prunsrv.exe //IS/MyService --Startup=auto --Description="My Service" --DisplayName="My Service" [2022-04-27 18:19:54] [warn] [ 472] Failed to grant service user 'NT AUTHORITY\LocalService' write permissions to log path '<default>' due to error '19' C:\Temp>echo %ERRORLEVEL% 0{code} While the service is installing in my test cases and the errorlevel is 0, I'm no longer seeing a commons-daemon.yyyy-mm-dd.log file being created even if I specify LogPath: {code:java} prunsrv.exe //IS/MyService2 --Startup=auto --Description="My Service" --DisplayName="My Service" --LogPath="C:\Temp" {code} > When installing a Windows service using Commons Daemon 1.3.0 the errorlevel > is -1073741819 > ------------------------------------------------------------------------------------------ > > Key: DAEMON-441 > URL: https://issues.apache.org/jira/browse/DAEMON-441 > Project: Commons Daemon > Issue Type: Bug > Affects Versions: 1.3.0 > Environment: Windows 2016 Datacenter > Reporter: Brian Andle > Priority: Major > Attachments: Command_Prompt.png > > > When attempting to use prunsrv.exe on Windows 2016 to create a service a > Windows Event error is logged and the errorlevel is returned as -1073741819 > Running the following command: > {code:java} > prunsrv.exe //IS/MyService --Startup=auto --Description=My Service > --DisplayName=My Service {code} > Results in the following Windows Event Log entry > > {code:java} > Faulting application name: prunsrv.exe, version: 1.3.0.0, time stamp: > 0x622b3ac0 > Faulting module name: prunsrv.exe, version: 1.3.0.0, time stamp: 0x622b3ac0 > Exception code: 0xc0000005 > Fault offset: 0x0000000000006e70 > Faulting process id: 0x1d88 > Faulting application start time: 0x01d845f90eb4351a > Faulting application path: C:\myfolder\prunsrv.exe > Faulting module path: C:\myfolder\prunsrv.exe > Report Id: 409b7098-42bd-4036-aa61-b19eecdb1bd7 > Faulting package full name: > Faulting package-relative application ID: {code} > Doing an echo %errorlevel% shows -1073741819 instead of the expected 0 > Version 1.2.4.0 works correctly on both Windows 10 and 2016 > *NOTE:* The service does appear to actually install on 2016, however most > deploy scripts will expect an error level of 0 and will fail if a non 0 value > it returned. > h3. Workaround > Define a *--LogPath* value and do not use the default > %SystemRoot%\System32\LogFiles\Apache path -- This message was sent by Atlassian Jira (v8.20.7#820007)