mysqld_safe is the recommended way to start the server on non-systemd systems ([1]). For instance, it has a crash detection with auto-restart function, can update ulimits, setup core files, set the niceness of the server etc. It looks like it could also be helpful when trying to set up clusters. It's maintained upstream and adding it means we don't need to add these features into our init script. mysqld_safe is a script itself, so it's added to conffiles in case users want to edit it. It can't be run under procd, so the init script is converted to a normal System V type. To stop the server and to reload the privileges tables mysqladmin is used. To that end mysqladmin is moved into the server package. While changing the init script, the Debian init script was used for ideas. It wasn't copied verbatim and adapted a bit here and there. Thanks to whoever wrote it! This commit removes the support for starting the service as a user other than "mariadb". This makes the init script simpler. If anybody wants to play around with the user then it's up to them to fix the permissions. [1] https://mariadb.com/kb/en/mysqld_safe/ Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
29 lines
791 B
Diff
29 lines
791 B
Diff
--- a/scripts/mysqld_safe.sh
|
|
+++ b/scripts/mysqld_safe.sh
|
|
@@ -242,7 +242,7 @@ wsrep_recover_position() {
|
|
return 1
|
|
fi
|
|
|
|
- local wr_pidfile="$DATADIR/"`@HOSTNAME@`"-recover.pid"
|
|
+ local wr_pidfile="$DATADIR/"$(uci get 'system.@system[0].hostname')"-recover.pid"
|
|
|
|
local wr_options="--disable-log-error --pid-file='$wr_pidfile'"
|
|
|
|
@@ -673,7 +673,7 @@ then
|
|
* ) err_log="$DATADIR/$err_log" ;;
|
|
esac
|
|
else
|
|
- err_log=$DATADIR/`@HOSTNAME@`.err
|
|
+ err_log=$DATADIR/$(uci get 'system.@system[0].hostname').err
|
|
fi
|
|
fi
|
|
|
|
@@ -752,7 +752,7 @@ fi
|
|
|
|
if test -z "$pid_file"
|
|
then
|
|
- pid_file="`@HOSTNAME@`.pid"
|
|
+ pid_file="$(uci get 'system.@system[0].hostname').pid"
|
|
fi
|
|
# MariaDB wants pid file without datadir
|
|
append_arg_to_args "--pid-file=$pid_file"
|