jamesfredley commented on code in PR #15698:
URL: https://github.com/apache/grails-core/pull/15698#discussion_r3391609612


##########
grails-profiles/base/commands/stop-app.groovy:
##########


Review Comment:
   Thanks for trying it. The failure path should be addressed now: bootRun 
itself now gets a default cli.pid.file under the Gradle build directory, and 
run-app still passes the explicit CLI path. That means the forked app writes 
the PID file stop-app reads, including from interactive mode and from a 
separate CLI invocation. I also added TestKit coverage for both the default 
bootRun PID path and the CLI override path.



##########
grails-doc/src/en/ref/Command Line/stop-app.adoc:
##########
@@ -25,30 +25,38 @@ under the License.
 === Purpose
 
 
-Stops a running Grails application in an embedded servlet container.
+Stops a Grails application that was started with the 
link:{commandLineRef}run-app.html[run-app] command.
 
-NOTE: This command will work in development mode only.
+NOTE: This command works in development mode only.
 
 
 === Examples
 
 
 [source,groovy]
 ----
-grails stop-app
-grails stop-app --port=9090 --host=mywebsite
+$ grails
+grails> run-app
+grails> stop-app
+----
+
+It can also be run as a separate invocation, including from a different 
terminal than the one that started the application:
+
+[source,bash]
+----
+$ grails stop-app
 ----
 
 
 === Description
 
 
-Arguments:
+When an application is started with `run-app`, it runs as a forked Gradle 
`bootRun` process which writes its process id to a `run-app.pid` file in the 
project `build` directory. The `stop-app` command reads that file and asks the 
operating system to stop the process, then removes the file.
+
+Because the running process is tracked through a file on disk rather than 
in-memory state, `stop-app` can stop the application even when it was forked 
into a separate process or when `stop-app` is run from a different `grails` 
invocation than the one that started it.
 
-* `port` - Specifies the port which the Grails application is running on 
(defaults to 8080 for HTTP or 8443 for HTTPS)
-* `host` - Specifies the host the Grails application is bound to
+This is a CLI only mechanism: it does not require the Spring Boot Actuator 
shutdown endpoint to be enabled, nor does it rely on JMX.

Review Comment:
   Agreed. I simplified the command reference so it now describes only the 
user-facing behavior: interactive/separate invocation usage, current-project 
run-app scope, unsupported host/port options, and the not-running result. The 
PID/Actuator/JMX implementation explanation is removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to