Hi everybody, I spent a bit of time cleaning cman init script to be a lot easier to read (IMHO), more maintainable and ready to be expanded to fix some outstanding issues.
major highlights: - clean up all over - grouping of functions - made ready for extensions (specially at startup time) - remove tons of duplicate stuff around - try to standardize a bit the way of writing the shell script - run in quiet/terse/full output mode The final script is tons of times smaller than the whole patchset. So I published a fabbione_cmaninit branch for people to look at history of changes. In attachment there is a copy of the new one. Two notes (I know somebody is going to ask): 1) On startup (eg): start_foo() { start_daemon foo } all those wrappers look the same. It's preparation to extend them. In our current startup sequence, we do start a daemon, we make sure it starts, but we never check if it's actually working properly. As time goes, and I also need feedback from different daemons maintainer, those snippets will change to look like: start_foo() { start_daemon foo || return 1 check_if_daemon_foo_is_working } similar to what we do with cman that we wait for quorum and we check cman_is_running via cman_status. Those checks will make our init script a lot more robust than it is now. 2) On shutdown (eg): I did slow down the shutdown time by adding a sleep 1 after each kill invokation. This will give a bit of time for each daemon to exit. Note that the timer is configurable (see for example stop_qdiskd). Please give it a shot and let me know. I plan to land this one in master and stable3 sometime next week. It's not a blocker for 3.0.0 final. Fabio
cman.in
Description: application/shellscript