You are not logged in.

#1 2018-09-29 19:04:40

edoelas
Member
Registered: 2018-04-27
Posts: 56

[SOLVED] Can't start mariadb.service

I was working in a project where I need a local database and I decided to use mariadb. I installed it following the arch wiki and everything worked fine. That was like a week ago. This morning I have reinstalled using pacman -S mariadb and I couldn't make it work again. I have tried to unistall it using pacman -Rns mariadb and following again the arch wiki, but it does not seem to work. The problem comes when I try to start the mariadb.service:

systemctl start mariadb.service
---
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
systemctl status mariadb.service
---
● mariadb.service - MariaDB 10.1.36 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendo>
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─mariadb.conf
   Active: failed (Result: exit-code) since Sat 2018-09-29 22:42:11 CEST; >
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
 Main PID: 1996 (code=exited, status=203/EXEC)

And executinc journalcl -xe I can't se anything related to mariadb.

Thanks!

EDIT 1

sudo journalctl _PID=1996
---
-- Logs begin at Sat 2018-08-25 13:14:09 CEST, end at Sat 2018-09-29 23:10:13 CEST. --
Sep 29 22:42:11 leonardo systemd[1996]: mariadb.service: Failed to execute command: No such file or directory
Sep 29 22:42:11 leonardo systemd[1996]: mariadb.service: Failed at step EXEC spawning /usr/bin/numactl: No such file or directory

EDIT 2

systemctl cat mariadb.service
---
# /usr/lib/systemd/system/mariadb.service
#
# /etc/systemd/system/mariadb.service
#
# 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.
#
# Thanks to:
# Daniel Black
# Erkan Yanar
# David Strauss
# and probably others

[Unit]
Description=MariaDB 10.1.36 database server
Documentation=man:mysqld(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target
After=syslog.target

[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 mysqld option.
PrivateNetwork=false

##############################################################################
## Package maintainers
##

User=mysql
Group=mysql

# To allow memlock to be used as non-root user if set in configuration
CapabilityBoundingSet=CAP_IPC_LOCK

# Prevent writes to /usr, /boot, and /etc
ProtectSystem=full

# Doesn't yet work properly with SELinux enabled
# NoNewPrivileges=true

PrivateDevices=true

# Prevent accessing /home, /root and /run/user
ProtectHome=true

# Execute pre and post scripts as root, otherwise it does it as User=
PermissionsStartOnly=true



# Perform automatic wsrep recovery. When server is started without wsrep,
# galera_recovery simply returns an empty string. In any case, however,
# the script is not expected to return with a non-zero status.
# It is always safe to unset _WSREP_START_POSITION environment variable.
# Do not panic if galera_recovery script is not available. (MDEV-10538)
ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
 VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
 && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"

# Needed to create system tables etc.
# ExecStartPre=/usr/bin/mysql_install_db -u mysql

# Start main service
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf
# Use the [Service] section and Environment="MYSQLD_OPTS=...".
# This isn't a replacement for my.cnf.
# _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster
ExecStart=/usr/bin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION


# Unset _WSREP_START_POSITION environment variable.
ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"

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-abort
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 under [Service] will override this file's
## settings.

# Useful options not previously available in [mysqld_safe]

# Kernels like killing mysqld 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=true

##
## 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-file-limit
LimitNOFILE=16364

# 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/bin/mysqld......

# crash-script equalivent
# FailureAction=

# /etc/systemd/system/mariadb.service.d/mariadb.conf
[Service]

ExecStart=
ExecStart=/usr/bin/numactl --interleave=all  /usr/sbin/mysqld ${MYSQLD_OPTS} ${_WSREP_NEW_CLUSTER} ${_WSREP_START_POSITION}
ProtectHome=false

Last edited by edoelas (2019-02-17 12:02:52)

Offline

#2 2018-09-29 19:08:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Can't start mariadb.service

Pacman is your package manager...

Post the output of `journalctl _PID=1996` (or whatever mariadb is now) and don't truncate the output as you have done above.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2018-09-29 19:14:33

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] Can't start mariadb.service

I have edited the main post in order to keep all organized and discovered that journal -xe was not showing anything due to that I was not runing it with sudo.
PD: do you know how can I insert inline code?

Offline

#4 2018-09-29 19:42:56

loqs
Member
Registered: 2014-03-06
Posts: 18,335

Re: [SOLVED] Can't start mariadb.service

What is the output of

systemctl cat mariadb.service

Offline

#5 2018-09-29 19:49:41

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] Can't start mariadb.service

I have edited the first post.
Thanks!

Offline

#6 2018-09-29 19:54:00

loqs
Member
Registered: 2014-03-06
Posts: 18,335

Re: [SOLVED] Can't start mariadb.service

Who or what created /etc/systemd/system/mariadb.service.d/mariadb.conf which added the use of numactl?

Offline

#7 2018-09-29 20:00:27

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] Can't start mariadb.service

I supose I'm the one who has done that (due to that im the only one with acces to this system) while trying to install fresh rss.

Offline

#8 2018-09-29 20:16:03

loqs
Member
Registered: 2014-03-06
Posts: 18,335

Re: [SOLVED] Can't start mariadb.service

If you remove the /etc/systemd/system/mariadb.service.d/mariadb.conf drop in override does mariadb start correctly then?

Offline

#9 2018-09-29 20:27:59

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] Can't start mariadb.service

I'm not sure what does the part of "drop in override" mean and I do not want to make my situation worst (my english is preatty poor). Could you explain me what exactly should I do? Just remove the /etc/systemd/system/mariadb.service.d/mariadb.conf or something more?
PD: How can I stop the mariadb.service without restarting the computer? systemctl stop mariadb.service and systemctl stop mariadb.service do not seem to work.

Last edited by edoelas (2018-09-29 20:32:23)

Offline

#10 2018-09-29 20:48:17

loqs
Member
Registered: 2014-03-06
Posts: 18,335

Re: [SOLVED] Can't start mariadb.service

edoelas wrote:

I'm not sure what does the part of "drop in override" mean and I do not want to make my situation worst (my english is preatty poor). Could you explain me what exactly should I do? Just remove the /etc/systemd/system/mariadb.service.d/mariadb.conf or something more?

`man systemd.unit` explains the drop- in overrides.  Remove /etc/systemd/system/mariadb.service.d/mariadb.conf then `systemctl daemon-reload` so systemd will reload the service file see also man systemctl.

edoelas wrote:

PD: How can I stop the mariadb.service without restarting the computer? systemctl stop mariadb.service and systemctl stop mariadb.service do not seem to work.

What do you mean do not seem to work?
Edit:
From Systemd#Drop-in_files

systemctl revert unit

Last edited by loqs (2018-09-29 20:51:03)

Offline

#11 2018-09-29 21:04:27

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] Can't start mariadb.service

THANK YOU!!! Now it seems to work.

I tried to mean that if I ran systemctl I still could see the mariadb row in red color.

Offline

Board footer

Powered by FluxBB