-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This introduces new run_process() and screen_service() functions and sets the groundwork to change how DevStack starts services. screen_service() is simply a direct call to the screen portion of the old screen_it() function and is intended to run commands that only need to run under screen, such as log file watchers. run_process() is a replacement for screen_it() (which remains until all of the services are updated). The usage is similar but requires updates to every current screen_it() call to remove everything that requires the command to be interpreted by a shell. The old run_process() and _run_process() functions are still present as old_run_process() and _old_run_process() to support the deprecated screen_it() function. These will all go away in the future once all services have been confirmed to have been changed over. There is a similar new set of stop process functions stop_process() and screen_stop_service(). The old screen_stop() will also remain for the deprecation period. As an initial test/demostration this review also includes the changes for lib/cinder to demonstrate what is required for every service. I included the scripts I used to test this; tests/fake-service.sh and tests/run-process.sh are quite rough around the edges and may bite. They should mature into productive members of the testing ecosystem someday. Change-Id: I03322bf0208353ebd267811735c66f13a516637b
- Loading branch information
Dean Troyer
authored and
Chris Dent
committed
Sep 9, 2014
1 parent
4bd4264
commit 3159a82
Showing
4 changed files
with
279 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
# fake-service.sh - a fake service for start/stop testing | ||
# $1 - sleep time | ||
|
||
SLEEP_TIME=${1:-3} | ||
|
||
LOG=/tmp/fake-service.log | ||
TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"} | ||
|
||
# duplicate output | ||
exec 1> >(tee -a ${LOG}) | ||
|
||
echo "" | ||
echo "Starting fake-service for ${SLEEP_TIME}" | ||
while true; do | ||
echo "$(date +${TIMESTAMP_FORMAT}) [$$]" | ||
sleep ${SLEEP_TIME} | ||
done | ||
|
Oops, something went wrong.