rvalle commented on issue #3973: systemd dependency on db URL: https://github.com/apache/cloudstack/pull/3973#issuecomment-602026825 ok I did run the install test with restart after install. The database was not corrupted with Wants. So, this is the status: **Wants** seems sufficient for startup, shutdown and reboot. While still works if no mysql is installed. as @weizhouapache is pointing. **Requires** is stronger and will deal with things like shutting down CSM automatically if you happen to stop mysql (perhaps during a mysql update). Will also start mysql automatically at CSM startup even if is stopped, or will not start CSM if mysql is misconfigured. However it does require mysql to be present in the system. And you need to know if it is mysql or mariadb. What we can do from here? I think we should include Wants in the distribution file, because it causes no harm, and serves as a safeward. It will work and provide protection for most of the use cases. We still have the option to modify the service unit from /etc/systemd as discussed in #3954 adding a **Requires** once we know that the mysql/mariadb runs on localhost for sure. This could be dome from the script **cloudstack-setup-databases**. Another posibilty is simply to include an additional comment with instructions in the at the distrubuted Systemd. This comment could be extended to other depndencies, something like this in the provided Systemd script: ``` # Do not modify this file as your changes will be lost in the next CSM update. # If you need to add specific dependencies to this service unit do it in the # /etc/systemd/system/cloudstack-management.service.d/ directory # If you know that either mysql or mariadb is running on this system is a good idea to # add a Requires dependency there. Check systemd documentation for details ```
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
