I have a configuration of zabbix server with mysql backend. When I stop my host, the mysql server stops before the zabbix-server and consequently zabbix-server takes forever to stop. home64 ~ # systemctl cat zabbix-server.service # /lib/systemd/system/zabbix-server.service [Unit] Description=Zabbix server Documentation=https://zabbix.com/manuals After=syslog.target syslog.service network.target network-online.target postgresql.service After=postgresql-9.6.service postgresql-10.service After=postgresql-11.service postgresql-12.service [Service] User=zabbix Group=zabbix ExecStart=/usr/sbin/zabbix_server --foreground --config /etc/zabbix/zabbix_server.conf [Install] WantedBy=multi-user.target Should postgres/mysql be a Requirement for zabbix rather than After? If I understand this topic, After orders the startup of the services but doesn't care about dependencies at shutdown... of course, I have worked this around with an /etc/systemd/zabbix-server.d/override.conf, but a sane default would be good too. One of the options would be to ship the matching override file depending on the use flag...
there are three different cases: - postgresql: this can't be done as postgresql is slotted and we don't know what slot the user uses - mysql: though slotted, only one version of mysql can be installed - but atm i can't see mysql providing service file - oracle: we don't even provide that one if gentoo mysql would provide service file, i could at least for mysql provide zabbix service file that should work as is. but for now, i won't do that as afaics our mysql does not provide a service file. so your solution is atm imo the only appropriate.