databases/mysql{80,84,97}-server: Add rc script and user for MySQL Router
All three server ports build and install MySQL Router, but it was never
usable out of the box: there is no mysqlrouter user, no rc script, no
configuration directory, and no log, runtime or data directory. The only
trace of an integration was etc/logrotate.d/mysqlrouter, whose
"create 600 mysqlrouter mysqlrouter" refers to an account that no port
creates, so logrotate(8) skipped that entry with an error and exited
non-zero.
Upstream names that account itself: scripts/CMakeLists.txt sets
MYSQLROUTER_USER to "mysqlrouter", the built-in help of mysqlrouter
suggests --user=mysqlrouter, and the systemd unit shipped for Linux runs
the service under it.
Add the user and group, an rc script, and a configuration sample in
etc/mysqlrouter. mysqlrouter does not detach itself, so it runs under
daemon(8), which also writes the PID file that the postrotate script in
etc/logrotate.d/mysqlrouter expects. The runtime, log and data
directories
are created by the rc script, and only when they are missing, so a host
that already runs MySQL Router under a different account keeps working
untouched. This matches the init script in upstream's own packaging.
The service is off by default.
PR: 253245
Sponsored by: Netzkommune GmbH