Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mariadb-server: support mpkg/mdmg packaging with scripts to automatic…
…ally instantiate and start the deployed server. Refs #52144
- Loading branch information
1 parent
ec82cff
commit 2942e32
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
|
||
# MariaDB installer support, postinstall script | ||
# runs as root after installer successfully copies payload to destination | ||
# Adapted from https://github.com/MariaDB/server/blob/5.5/support-files/MacOSX/postflight.sh | ||
|
||
# Have experienced cases where installed directories/files have different | ||
# ownership or permissions than what was fed to PackageMaker. | ||
# Just use blunt force to set the required permissions | ||
|
||
chmod 644 @PREFIX@/etc/LaunchDaemons/org.macports.@SUBPORT@/org.macports.@SUBPORT@.plist || exit 1 | ||
if [ -f /Library/LaunchDaemons/org.macports.@SUBPORT@.plist ] ; then | ||
rm /Library/LaunchDaemons/org.macports.@SUBPORT@.plist | ||
fi | ||
ln -s @PREFIX@/etc/LaunchDaemons/org.macports.@SUBPORT@/org.macports.@SUBPORT@.plist \ | ||
/Library/LaunchDaemons/org.macports.@SUBPORT@.plist || exit 1 | ||
|
||
chown _mysql:_mysql @PREFIX@/var/run/@NAMEMYSQL@ || exit 1 | ||
chown _mysql:_mysql @PREFIX@/var/db/@NAMEMYSQL@ || exit 1 | ||
chown _mysql:_mysql @PREFIX@/var/log/@NAMEMYSQL@ || exit 1 | ||
|
||
|
||
# standard mysql initialization | ||
if [ ! -f @PREFIX@/var/db/@NAMEMYSQL@/mysql/db.frm ] ; then | ||
@PREFIX@/lib/@NAMEMYSQL@/bin/mysql_install_db --user=@USER@ \ | ||
--datadir=@PREFIX@/var/db/@NAMEMYSQL@ \ | ||
--tmpdir=@PREFIX@/var/db/@NAMEMYSQL@ | ||
fi | ||
|
||
# we should be able to trust that preinstall did this, but... | ||
# just in case still loaded, unload | ||
if /bin/launchctl list "org.macports.@SUBPORT@" &> /dev/null; then | ||
/bin/launchctl unload "/Library/LaunchDaemons/org.macports.@SUBPORT@.plist" | ||
fi | ||
|
||
# my.cnf may not be in place yet, but the server will run anyway | ||
/bin/launchctl load -w /Library/LaunchDaemons/org.macports.@SUBPORT@.plist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
# MariaDB installer support, preinstall script | ||
# runs as root just after user clicks "Install" | ||
|
||
# if daemon loaded, unload | ||
if /bin/launchctl list "org.macports.@SUBPORT@" &> /dev/null; then | ||
/bin/launchctl unload "/Library/LaunchDaemons/org.macports.@SUBPORT@.plist" | ||
fi |