[
https://issues.apache.org/jira/browse/DAEMON-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17682089#comment-17682089
]
Thomas Dewaelheyns commented on DAEMON-452:
-------------------------------------------
I think this is a good idea.
Related to this, on startup prunsrv creates the folder itself if it is missing
but not when the parent folder does not exist. Maybe the tool should create the
whole folder path, on both install and on startup, if they are missing.
> Should we create the target folder before apxSecurityGrantFileAccessToUser?
> ---------------------------------------------------------------------------
>
> Key: DAEMON-452
> URL: https://issues.apache.org/jira/browse/DAEMON-452
> Project: Commons Daemon
> Issue Type: Improvement
> Components: prunsrv
> Affects Versions: 1.3.3
> Environment: Windows
> Reporter: Gary D. Gregory
> Priority: Major
>
> Our API apxSecurityGrantFileAccessToUser will fail if the target folder does
> not exist.
> Shouldn't we create this folder in advance of this call?
> Names and paths obfuscated in this example:
> {code}
> [2023-01-27 13:55:39] [info] ( prunsrv.c:2018) [ 7340] Apache Commons Daemon
> procrun (1.3.3.0 64-bit) started.
> [2023-01-27 13:55:39] [debug] ( prunsrv.c:774 ) [ 7340] Installing service...
> [2023-01-27 13:55:39] [info] ( prunsrv.c:831 ) [ 7340] Installing service
> 'ABC' name 'XYZ'.
> [2023-01-27 13:55:39] [debug] ( prunsrv.c:860 ) [ 7340] Setting service
> description 'XYZ'.
> [2023-01-27 13:55:39] [warn] ( prunsrv.c:759 ) [ 7340] Failed to grant
> service user 'NT AUTHORITY\LocalService' write permissions to log path
> 'C:\ProgramData\Example Company\Example Product\10.3991.0.0\Default\logs' due
> to error '2: The system cannot find the file specified.'
> [2023-01-27 13:55:39] [info] ( prunsrv.c:882 ) [ 7340] Service 'ABC'
> installed.
> [2023-01-27 13:55:39] [info] ( prunsrv.c:2102) [ 7340] Apache Commons Daemon
> procrun finished.
> Service 'XYZ' was installed succesfully
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)