/usr/lib/systemd/system
# Multi instance version of MariaDB # # Use this if you run multiple instances of MariaDB on a single server. # # This systemd service is not suitable for Galera as specialised SST recovery # scripts are needed. # # # It's not recommended to modify this file in-place, because it will be # overwritten during package upgrades. If you want to customize, the # best way is to create a file "/etc/systemd/system/mariadb@.service", # containing # .include /usr/lib/systemd/system/mariadb@.service # ...make your changes here... # or create a file "/etc/systemd/system/mariadb@.service.d/foo.conf", # which doesn't need to include ".include" call and which will be parsed # after the file mariadb@.service itself is parsed. # # For more info about custom unit files, see systemd.unit(5) or # https://mariadb.com/kb/en/mariadb/systemd/ # # Copyright notice: # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # # MULTI INSTANCES # # When multiple instances of MariaDB are running on a server they need to # ensure that they don't conflict with each other. This includes elements # like network ports, sockets and data directories listed under CONFLICTING # VARIABLES below. The systemd environment variable MYSQLD_MULTI_INSTANCE # controls each instance to ensure it is run independently. It is passed to # mariadbd and mysql_install # # By default, a group suffix exists and within the default configuration # files, a group [mariadbd.{instancename}] is read for each service. Other # default groups, like [server.{instancename}] and [mariadb.{instancename}], # are also read. For each instance, one of the groups will need to contain # the conflicting variables listed below under CONFLICTING VARIABLES. # # The MYSQLD_MULTI_INSTANCE environment used is: # Environment='MYSQLD_MULTI_INSTANCE=--defaults-group-suffix=.%I --basedir=/usr' # # # APPLYING YOUR MULTI INSTANCE MECHANISM # # To apply one of the non-default multi-instance mechanisms, create a file # "/etc/systemd/system/mariadb@.service.d/multi.conf" containing: # # [Service] # Environment=MYSQLD_MULTI_INSTANCE="...." # # Include any other settings you which to override. Directives like Exec* are # lists and adding a directive will append to the list. You can clear the list # by starting with "Directive=" and no value. Follow this by the list that you # do want. See the systemd.unit(5) manual page for more information. # # Then run "systemctl daemon-reload". # # # EXAMPLE MYSQLD_MULTI_INSTANCE CONFIGURATIONS # # Configuration File Based Mechanism: # # This has a configuration file per instance. # # [Unit] # ConditionPathExists=/etc/my.%I.cnf # # [Service] # Environment=MYSQLD_MULTI_INSTANCE=--defaults-file=/etc/my.%I.cnf # # Here you need to create a configuration file /etc/my.%I.cnf for each # instance, each containing the conflicting variables to separate instances. # # # Multi User Based Mechanism: # # Here each user (the instance name) has their own mysql instance. # # Create instances in users home directory with abstract socket: # # [Service] # User=%I # ProtectHome=false # ExecStartPre= # ExecStartPre=/usr/bin/mariadb-install-db $MYSQLD_MULTI_INSTANCE \ # --auth-root-authentication-method=socket --auth-root-socket-user=%I # Environment=MYSQLD_MULTI_INSTANCE="--defaults-file=/home/%I/my%I.cnf \ # --datadir=/home/%I/mysqldatadir --skip-networking --socket=@mysql-%I" # # # Command Line Mechanism: # # This is a good way run multiple instance where there is little difference # in configuration between instances. # # [Service] # Environment=MYSQLD_MULTI_INSTANCE="--socket=/run/mysqld/%I.sock \ # --datadir=/var/lib/mysqld-multi/%I \ # --skip-networking" # # # CONFLICTING VARIABLES # # A number of MariaDB system variables may conflict. The main ones that need to # be set because their default values will conflict are: # * socket # * port # * datadir # # # PRE-10.4 # # Before 10.4 MYSQLD_MULTI_INSTANCE was effectively --defaults-file=/etc/my.cnf.d/my%I.cnf # As /etc/my.cnf included these files it was a bad choice as an # existing single instance would include all these files. If you want to # continue a file based multi-instance mariadbd, recommend the Configuration File # Based Mechanism above and moving /etc/my.cnf.d/my%I.cnf files to /etc/my%I.cnf. # # # SELINUX # # As basic selinux rules are written around a single instance of MariaDB you may need # to define labels for the files and network ports of all instances. # # See: https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#selinux # # # STARTING # # Start the instance: systemctl start mariadb@{instancename}.service # # # DOCUMENTATION: # # Read https://mariadb.com/kb/en/mariadb/systemd/ regarding customisation. # # Also see systemd man pages: systemd.unit(5), systemd.exec(5) and # systemd.service(5) [Unit] Description=MariaDB 10.11.15 database server (multi-instance %I) Documentation=man:mariadbd(8) Documentation=https://mariadb.com/kb/en/library/systemd/ After=network.target # Negated condition here is because 10.3 and before had /etc/my.cnf.d/my%I.cnf # as the configuration difference for multiple instances. This condition here # to prevent an accidental change during an upgrade in the case the user # created these file(s). # ## See Environment=MYSQLD_MULTI_INSTANCE below for current recommended options. ConditionPathExists=!/etc/my.cnf.d/my%I.cnf [Install] WantedBy=multi-user.target [Service] ############################################################################## ## Core requirements ## Type=notify # Setting this to true can break replication and the Type=notify settings # See also bind-address mariadbd option. PrivateNetwork=false ############################################################################## ## Package maintainers ## # CAP_IPC_LOCK To allow memlock to be used as non-root user # These are enabled by default AmbientCapabilities=CAP_IPC_LOCK # Prevent writes to /usr, /boot, and /etc ProtectSystem=full # Requires kernel 4.14 or later and SELinux transition rule for mysqld_t # (https://github.com/systemd/systemd/issues/3845) # NoNewPrivileges=true # Prevent accessing /home, /root and /run/user ProtectHome=true # Needed to create system tables etc. --rpm to not do pam permission changes. ExecStartPre=/usr/bin/mariadb-install-db $MYSQLD_MULTI_INSTANCE --rpm # Start main service # A few variables are here: # * MYSQLD_MULTI_INSTANCE - control how multiple instances are distinguisable # * MYSQLD_OPTS - user definable extras - not a replacement for my.cnf # # Note 1: Place $MYSQLD_OPTS at the very end for its options to take precedence. ExecStart=/usr/sbin/mariadbd $MYSQLD_MULTI_INSTANCE $MYSQLD_OPTS KillSignal=SIGTERM # Don't want to see an automated SIGKILL ever SendSIGKILL=no # Restart crashed server only, on-failure would also restart, for example, when # my.cnf contains unknown option Restart=on-abnormal RestartSec=5s UMask=007 ############################################################################## ## USERs can override ## ## ## by creating a file in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf ## and adding/setting the following below [Service] will override this file's ## settings. # Useful options not previously available in [mysqld_safe] # Kernels like killing mariadbd when out of memory because its big. # Lets temper that preference a little. # OOMScoreAdjust=-600 # Explicitly start with high IO priority # BlockIOWeight=1000 # If you don't use the /tmp directory for SELECT ... OUTFILE and # LOAD DATA INFILE you can enable PrivateTmp=true for a little more security. PrivateTmp=false # Set an explicit Start and Stop timeout of 900 seconds (15 minutes!) # this is the same value as used in SysV init scripts in the past # if you need a longer timeout, check the KB: # https://mariadb.com/kb/en/library/systemd/#configuring-the-systemd-service-timeout TimeoutStartSec=900 TimeoutStopSec=900 # Set the maximium number of tasks (threads) to 99% of what the system can # handle as set by the kernel, reserve the 1% for a remote ssh connection, # some monitoring, or that backup cron job. Without the directive this would # be 15% (see DefaultTasksMax in systemd man pages). TasksMax=99% # Controlling how multiple instances are separated. See top of this file. # Note: This service isn't User=mysql by default so we need to be explicit. # It is as an option here as a user may want to use the MYSQLD_MULTI_INSTANCE # to run multiple versions. Environment='MYSQLD_MULTI_INSTANCE=--defaults-group-suffix=.%I' # While you can override these, you shouldn't leave them empty as that # will default to root. User=mysql Group=mysql ## ## Options previously available to be set via [mysqld_safe] ## that now needs to be set by systemd config files as mysqld_safe ## isn't executed. ## # Number of files limit. previously [mysqld_safe] open-files-limit LimitNOFILE=32768 # For liburing and io_uring_setup() LimitMEMLOCK=524288 # Maximium core size. previously [mysqld_safe] core-file-size # LimitCore= # Nice priority. previously [mysqld_safe] nice # Nice=-5 # Timezone. previously [mysqld_safe] timezone # Environment="TZ=UTC" # Library substitutions. previously [mysqld_safe] malloc-lib with explicit paths # (in LD_LIBRARY_PATH) and library name (in LD_PRELOAD). # Environment="LD_LIBRARY_PATH=/path1 /path2" "LD_PRELOAD= # Flush caches. previously [mysqld_safe] flush-caches=1 # ExecStartPre=sync # ExecStartPre=sysctl -q -w vm.drop_caches=3 # numa-interleave=1 equalivant # Change ExecStart=numactl --interleave=all /usr/sbin/mariadbd...... # crash-script equalivent # FailureAction=
-.slice.d
Edit
.
Edit
..
Edit
NetworkManager-dispatcher.service
Edit
NetworkManager-wait-online.service
Edit
NetworkManager.service
Edit
aibolit-resident.service
Edit
aibolit-resident.socket
Edit
alt-php54-fpm.service
Edit
alt-php72-fpm.service
Edit
alt-php72-newrelic-daemon.service
Edit
alt-php74-fpm.service
Edit
alt-php74-newrelic-daemon.service
Edit
alt-php81-fpm.service
Edit
alt-php84-fpm.service
Edit
alt-php84-newrelic-daemon.service
Edit
alt-redis-sentinel.service
Edit
alt-redis.service
Edit
arp-ethers.service
Edit
atd.service
Edit
auditd.service
Edit
auth-rpcgss-module.service
Edit
autovt@.service
Edit
basic.target
Edit
basic.target.wants
Edit
blockdev@.target
Edit
bluetooth.target
Edit
boot-complete.target
Edit
cagefs.service
Edit
canberra-system-bootup.service
Edit
canberra-system-shutdown-reboot.service
Edit
canberra-system-shutdown.service
Edit
certbot-renew.service
Edit
certbot-renew.timer
Edit
chrony-wait.service
Edit
chronyd-restricted.service
Edit
chronyd.service
Edit
console-getty.service
Edit
container-getty@.service
Edit
cpupower.service
Edit
crond.service
Edit
cryptsetup-pre.target
Edit
cryptsetup.target
Edit
csf.service
Edit
ctrl-alt-del.target
Edit
dbus-broker.service
Edit
dbus-org.freedesktop.hostname1.service
Edit
dbus-org.freedesktop.locale1.service
Edit
dbus-org.freedesktop.login1.service
Edit
dbus-org.freedesktop.timedate1.service
Edit
dbus.socket
Edit
dbus.target.wants
Edit
debug-shell.service
Edit
default.target
Edit
default.target.wants
Edit
dev-hugepages.mount
Edit
dev-mqueue.mount
Edit
dnf-makecache.service
Edit
dnf-makecache.timer
Edit
dnf-system-upgrade-cleanup.service
Edit
dnf-system-upgrade.service
Edit
dracut-cmdline.service
Edit
dracut-initqueue.service
Edit
dracut-mount.service
Edit
dracut-pre-mount.service
Edit
dracut-pre-pivot.service
Edit
dracut-pre-trigger.service
Edit
dracut-pre-udev.service
Edit
dracut-shutdown-onfailure.service
Edit
dracut-shutdown.service
Edit
ea-php56-php-fpm.service
Edit
ea-php74-php-fpm.service
Edit
ea-php81-php-fpm.service
Edit
ea-php82-php-fpm.service
Edit
ea-php83-php-fpm.service
Edit
ea-php84-php-fpm.service
Edit
emergency.service
Edit
emergency.target
Edit
exit.target
Edit
factory-reset.target
Edit
final.target
Edit
firebird.service
Edit
firewalld.service
Edit
first-boot-complete.target
Edit
flatpak-system-helper.service
Edit
fstrim.service
Edit
fstrim.timer
Edit
garb.service
Edit
geoclue.service
Edit
getty-pre.target
Edit
getty.target
Edit
getty@.service
Edit
glances.service
Edit
grafana-server.service
Edit
graphical.target
Edit
graphical.target.wants
Edit
grub-boot-indeterminate.service
Edit
grub2-systemd-integration.service
Edit
gssproxy.service
Edit
halt.target
Edit
hibernate.target
Edit
htcacheclean.service
Edit
httpd.service
Edit
hybrid-sleep.target
Edit
import-state.service
Edit
imunify-agent-proxy.service
Edit
imunify-agent-proxy.socket
Edit
imunify-antivirus-sensor.socket
Edit
imunify-antivirus-user.socket
Edit
imunify-antivirus.service
Edit
imunify-antivirus.socket
Edit
imunify-auditd-log-reader.service
Edit
imunify-notifier.service
Edit
imunify-notifier.socket
Edit
imunify-realtime-av.service
Edit
imunify360-agent-user.socket
Edit
imunify360-agent.service
Edit
imunify360-agent.socket
Edit
imunify360-dos-protection.service
Edit
imunify360-pam.service
Edit
imunify360-pam.socket
Edit
imunify360-php-daemon.service
Edit
imunify360-php-daemon.socket
Edit
imunify360-pure.service
Edit
imunify360-resource-unlock@.service
Edit
imunify360-resource-unlock@.timer
Edit
imunify360-scanlogd.service
Edit
imunify360-unified-access-logger.service
Edit
imunify360-wafd.service
Edit
imunify360-webshield-ssl-cache.service
Edit
imunify360-webshield.service
Edit
imunify360.service
Edit
initrd-cleanup.service
Edit
initrd-fs.target
Edit
initrd-parse-etc.service
Edit
initrd-root-device.target
Edit
initrd-root-device.target.wants
Edit
initrd-root-fs.target
Edit
initrd-root-fs.target.wants
Edit
initrd-switch-root.service
Edit
initrd-switch-root.target
Edit
initrd-udevadm-cleanup-db.service
Edit
initrd-usr-fs.target
Edit
initrd.target
Edit
initrd.target.wants
Edit
integritysetup-pre.target
Edit
integritysetup.target
Edit
irqbalance.service
Edit
jetbackup5d.service
Edit
jetmongod.service
Edit
kdump.service
Edit
kexec.target
Edit
kmod-static-nodes.service
Edit
kvm_stat.service
Edit
ldconfig.service
Edit
lfd.service
Edit
loadmodules.service
Edit
local-fs-pre.target
Edit
local-fs.target
Edit
logrotate.service
Edit
logrotate.timer
Edit
low-memory-monitor.service
Edit
lve.service
Edit
lve_namespaces.service
Edit
lvectl.service
Edit
lvemanager.service
Edit
lvestats-burstwatcher-config.service
Edit
lvestats-burstwatcher.service
Edit
lvestats.service
Edit
maldet.service
Edit
man-db-cache-update.service
Edit
man-db-restart-cache-update.service
Edit
mariadb-extra.socket
Edit
mariadb-extra@.socket
Edit
mariadb.service
Edit
mariadb.socket
Edit
mariadb@.service
Edit
mariadb@.socket
Edit
mariadb@bootstrap.service.d
Edit
microcode.service
Edit
modprobe@.service
Edit
multi-user.target
Edit
multi-user.target.wants
Edit
mysql.service
Edit
mysqld.service
Edit
named-setup-rndc.service
Edit
named.service
Edit
netdata-updater.service
Edit
netdata-updater.timer
Edit
netdata.service
Edit
network-online.target
Edit
network-pre.target
Edit
network.target
Edit
nfs-blkmap.service
Edit
nfs-client.target
Edit
nfs-idmapd.service
Edit
nfs-mountd.service
Edit
nfs-server.service
Edit
nfs-utils.service
Edit
nfsdcld.service
Edit
nftables.service
Edit
nis-domainname.service
Edit
nm-priv-helper.service
Edit
nscd.service
Edit
nscd.socket
Edit
nss-lookup.target
Edit
nss-user-lookup.target
Edit
ossec-hids-authd.service
Edit
ossec-hids-hybrid.service
Edit
ossec-hids.service
Edit
pam_namespace.service
Edit
paths.target
Edit
pdns.service
Edit
pdns@.service
Edit
polkit.service
Edit
poweroff.target
Edit
printer.target
Edit
proc-fs-nfsd.mount
Edit
proc-sys-fs-binfmt_misc.automount
Edit
proc-sys-fs-binfmt_misc.mount
Edit
proxyexecd.service
Edit
quotaon.service
Edit
rc-local.service
Edit
rdisc.service
Edit
reboot.target
Edit
reboot.target.wants
Edit
remote-cryptsetup.target
Edit
remote-fs-pre.target
Edit
remote-fs.target
Edit
remote-fs.target.wants
Edit
remote-veritysetup.target
Edit
rescue.service
Edit
rescue.target
Edit
rescue.target.wants
Edit
rhnsd.service
Edit
rpc-gssd.service
Edit
rpc-statd-notify.service
Edit
rpc-statd.service
Edit
rpc_pipefs.target
Edit
rpcbind.service
Edit
rpcbind.socket
Edit
rpcbind.target
Edit
rpmdb-rebuild.service
Edit
rrdcached.service
Edit
rrdcached.socket
Edit
rtkit-daemon.service
Edit
runlevel0.target
Edit
runlevel1.target
Edit
runlevel1.target.wants
Edit
runlevel2.target
Edit
runlevel2.target.wants
Edit
runlevel3.target
Edit
runlevel3.target.wants
Edit
runlevel4.target
Edit
runlevel4.target.wants
Edit
runlevel5.target
Edit
runlevel5.target.wants
Edit
runlevel6.target
Edit
saslauthd.service
Edit
selinux-autorelabel-mark.service
Edit
selinux-autorelabel.service
Edit
selinux-autorelabel.target
Edit
selinux-check-proper-disable.service
Edit
serial-getty@.service
Edit
shutdown.target
Edit
sigpwr.target
Edit
sleep.target
Edit
slices.target
Edit
smartcard.target
Edit
smartd.service
Edit
sockets.target
Edit
sockets.target.wants
Edit
sound.target
Edit
ssa-agent.service
Edit
ssa-agent.socket
Edit
sshd-keygen.target
Edit
sshd-keygen@.service
Edit
sshd.service
Edit
sshd.socket
Edit
sshd@.service
Edit
sssd-autofs.service
Edit
sssd-autofs.socket
Edit
sssd-kcm.service
Edit
sssd-kcm.socket
Edit
sssd-nss.service
Edit
sssd-nss.socket
Edit
sssd-pac.service
Edit
sssd-pac.socket
Edit
sssd-pam-priv.socket
Edit
sssd-pam.service
Edit
sssd-pam.socket
Edit
sssd-ssh.service
Edit
sssd-ssh.socket
Edit
sssd-sudo.service
Edit
sssd-sudo.socket
Edit
sssd.service
Edit
suspend-then-hibernate.target
Edit
suspend.target
Edit
sw-engine.service
Edit
sw-engine.service.d
Edit
swap.target
Edit
sys-fs-fuse-connections.mount
Edit
sys-kernel-config.mount
Edit
sys-kernel-debug.mount
Edit
sys-kernel-tracing.mount
Edit
sysinit.target
Edit
sysinit.target.wants
Edit
syslog.socket
Edit
syslog.target.wants
Edit
sysstat-collect.service
Edit
sysstat-collect.timer
Edit
sysstat-summary.service
Edit
sysstat-summary.timer
Edit
sysstat.service
Edit
system-systemd\x2dcryptsetup.slice
Edit
system-update-cleanup.service
Edit
system-update-pre.target
Edit
system-update.target
Edit
system-update.target.wants
Edit
systemd-ask-password-console.path
Edit
systemd-ask-password-console.service
Edit
systemd-ask-password-wall.path
Edit
systemd-ask-password-wall.service
Edit
systemd-backlight@.service
Edit
systemd-binfmt.service
Edit
systemd-bless-boot.service
Edit
systemd-boot-check-no-failures.service
Edit
systemd-boot-random-seed.service
Edit
systemd-boot-update.service
Edit
systemd-coredump.socket
Edit
systemd-coredump@.service
Edit
systemd-exit.service
Edit
systemd-firstboot.service
Edit
systemd-fsck-root.service
Edit
systemd-fsck@.service
Edit
systemd-growfs-root.service
Edit
systemd-growfs@.service
Edit
systemd-halt.service
Edit
systemd-hibernate-resume@.service
Edit
systemd-hibernate.service
Edit
systemd-hostnamed.service
Edit
systemd-hostnamed.service.d
Edit
systemd-hwdb-update.service
Edit
systemd-hybrid-sleep.service
Edit
systemd-initctl.service
Edit
systemd-initctl.socket
Edit
systemd-journal-catalog-update.service
Edit
systemd-journal-flush.service
Edit
systemd-journald-audit.socket
Edit
systemd-journald-dev-log.socket
Edit
systemd-journald-varlink@.socket
Edit
systemd-journald.service
Edit
systemd-journald.socket
Edit
systemd-journald@.service
Edit
systemd-journald@.socket
Edit
systemd-kexec.service
Edit
systemd-localed.service
Edit
systemd-logind.service
Edit
systemd-logind.service.d
Edit
systemd-machine-id-commit.service
Edit
systemd-modules-load.service
Edit
systemd-network-generator.service
Edit
systemd-pcrfs-root.service
Edit
systemd-pcrfs@.service
Edit
systemd-pcrmachine.service
Edit
systemd-pcrphase-initrd.service
Edit
systemd-pcrphase-sysinit.service
Edit
systemd-pcrphase.service
Edit
systemd-poweroff.service
Edit
systemd-pstore.service
Edit
systemd-quotacheck.service
Edit
systemd-random-seed.service
Edit
systemd-reboot.service
Edit
systemd-remount-fs.service
Edit
systemd-repart.service
Edit
systemd-rfkill.service
Edit
systemd-rfkill.socket
Edit
systemd-suspend-then-hibernate.service
Edit
systemd-suspend.service
Edit
systemd-sysctl.service
Edit
systemd-sysext.service
Edit
systemd-sysupdate-reboot.service
Edit
systemd-sysupdate-reboot.timer
Edit
systemd-sysupdate.service
Edit
systemd-sysupdate.timer
Edit
systemd-sysusers.service
Edit
systemd-timedated.service
Edit
systemd-tmpfiles-clean.service
Edit
systemd-tmpfiles-clean.timer
Edit
systemd-tmpfiles-setup-dev.service
Edit
systemd-tmpfiles-setup.service
Edit
systemd-udev-settle.service
Edit
systemd-udev-trigger.service
Edit
systemd-udev-trigger.service.d
Edit
systemd-udevd-control.socket
Edit
systemd-udevd-kernel.socket
Edit
systemd-udevd.service
Edit
systemd-update-done.service
Edit
systemd-update-utmp-runlevel.service
Edit
systemd-update-utmp.service
Edit
systemd-user-sessions.service
Edit
systemd-vconsole-setup.service
Edit
systemd-volatile-root.service
Edit
teamd@.service
Edit
time-set.target
Edit
time-sync.target
Edit
timers.target
Edit
timers.target.wants
Edit
tmp.mount
Edit
tuned.service
Edit
uml_switchd.service
Edit
umount.target
Edit
upower.service
Edit
usb-gadget.target
Edit
user-.slice.d
Edit
user-runtime-dir@.service
Edit
user.slice
Edit
user@.service
Edit
user@.service.d
Edit
user@0.service.d
Edit
var-lib-nfs-rpc_pipefs.mount
Edit
veritysetup-pre.target
Edit
veritysetup.target
Edit
wp-toolkit-background-tasks.service
Edit
wp-toolkit-scheduled-tasks.service
Edit
xray-agent.service
Edit
xray-agent.socket
Edit
xray-user-agent.service
Edit
xray-user-agent.socket
Edit