[MDEV-19850] per-plugin install/uninstall scriptlets Created: 2019-06-24  Updated: 2023-05-27

Status: Stalled
Project: MariaDB Server
Component/s: Plugins
Fix Version/s: None

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-19852 Change plugin API to allow plugins to... Closed
Relates
relates to MDEV-22979 "mysqld --bootstrap" / mysql_install_... Closed
relates to MDEV-27095 Simplify spider init queries Closed
relates to MDEV-19842 Crash while creating statistics for S... Closed
relates to MDEV-19876 pam v2: auth_pam_tool_dir and auth_pa... Closed
relates to MDEV-22482 pam v2: mysql_upgrade doesn't fix the... Open

 Description   

plugins should be able to provide install/uninstall/upgrade scriptlets (at least shell, perhaps sql too).

they'll be called at the appropriate places by rpm/dpkg as needed.

in bintars install scriptlets will be run by mysql_install_db and mysql_upgrade.

See also MDEV-19852



 Comments   
Comment by Sergei Golubchik [ 2019-07-09 ]

Another option (as suggested in MDEV-19852) would be to run them on INSTALL/UNINSTALL PLUGIN.

That might work if there's an SQL scriptlet to run. But it cannot do a shell scriptlet.

Comment by Sergei Golubchik [ 2019-07-10 ]

shell scriptlets can be used by pam plugin to fix filesystem permissions

Comment by Sergei Golubchik [ 2019-09-15 ]

running from rpm/deb:
run when a plugin package (or a server package with a plugin) is installed
run on upgrades too
somewhat different code for rpms and debs
bintar packages can only do it from mysql_install_db
mysql_install_db doesn't handle upgrades. mysql_upgrade ?
sql scriptlets need a running server
Should a plugin be active when its sql scriptlet is run? or is a scriptlet a prerequisite for a plugin being able to start?

Comment by Sergei Golubchik [ 2019-09-15 ]

running sql scriptlets by the server on INSTALL PLUGIN:
uniform treatment for rpm/deb/bintar
needs a new version column in mysql.plugin to detect upgrades
doesn't support shell scriptlets (but it can run wsrep scripts, so why not?)
--plugin-load is treated like installing on every server startup (up to the script to detect it?)

Generated at Thu Feb 08 08:54:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.