[
https://issues.apache.org/jira/browse/KARAF-4499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15245727#comment-15245727
]
Tom Jenkinson commented on KARAF-4499:
--------------------------------------
The reason I think it is hanging (Windows 10) is because the tasklist filter
"Status eq running" seems to fail
{quote}
C:\Users\tom>tasklist /fi "PID eq 11884"
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
java.exe 11884 Console 1 229,376 K
C:\Users\tom>tasklist /fi "PID eq 11884" /fi "STATUS eq running"
INFO: No tasks are running which match the specified criteria.
{quote}
So it does down the wrong path.
This must somehow be intermittent as my earlier testing today worked. Funnily
in "Task Manager" this process status is correctly reporting as "Running" I
would consider dropping the /fi "STATUS eq running" clause as the /fi "PID eq
%ROOT_INSTANCE_PID%" would be enough for the errorlevel anyway?
I moved my change to:
tasklist /fi "PID eq %ROOT_INSTANCE_PID%" /fo 2>NUL
if "%ERRORLEVEL%"=="0" set ROOT_INSTANCE_RUNNING=true
(note the "set ROOT_INSTANCE_RUNNING" not "set %ROOT_INSTANCE_RUNNING%")
Earlier in the day I was experimenting with delayedexpansion - maybe that
affected my shell.
> Can't start a crashed server on Windows
> ---------------------------------------
>
> Key: KARAF-4499
> URL: https://issues.apache.org/jira/browse/KARAF-4499
> Project: Karaf
> Issue Type: Bug
> Components: karaf-shell
> Environment: Windows 10
> Reporter: Tom Jenkinson
>
> On Windows if a server crashes karaf.bat does not allow me to start the
> server again. I have tracked this to an algorithm in the file that checks for
> the PID and sets a variable, on Windows (10 at least) to be able to overwrite
> the variable you need to use a slightly different notation.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)