On my Fedora 23 system a database is started by systemd. Another service (hive-metastore) that depends on that database ist started through a init.d script. I'am unclear about what would be the correct way to make those services start in the right order (database before hive-megastore).
1 Answers
It's quite likely that the best solution is simply to write a systemd unit for the hive-metastore service - so long as it has the same name systemd will use it in preference to the init script and it will likely be a lot easier to read and a lot more reliable.
You can control the ordering without that though, by adding Before=hive-metastore.service
to the database service unit. That's best done using a dropin fragment, so create something like /etc/systemd/system/database-name.service.d/hive-metastore.conf
with this content:
[Unit]
Before=hive-metastore.service
It's not quite what you would do if both were native systemd units, as in that case you would likely add the configuration to the other service, and use both After
to control the ordering and Requires
to ensure the database is started, but the ordering alone is sufficient if both services are enabled and ordering can be controlled from either end of the dependency.
- 1,290
- 7
- 9