I am running an Arch Linux (latest, up-to-date) box, and attempting to get MySQL to start at boot. With the systemd package installed I have systemctl available, and as such I can do things like this:

systemctl start mysqld.service
systemctl [stop|status|restart] mysqld.service

That's all fine, and works great when I want to start/stop manually, however, when it comes to getting it to start at boot (by using 'enable' on systemctl, I get some nasty output):

[root@rudivarch ~]# systemctl enable mysqld.service
Failed to issue method call: No such file or directory

Obviously, since the other commands work just fine, I'm seriously confused by this and have spent a good while trying to figure it out... systemctl status outputs this:

[root@rudivarch ~]# systemctl status mysqld.service
     Loaded: loaded (/etc/rc.d/mysqld)
     Active: inactive (dead) since Tue, 31 Jan 2012 15:32:28 +0000; 1min 25s ago
    Process: 589 ExecStop=/etc/rc.d/mysqld stop (code=exited, status=0/SUCCESS)
    Process: 257 ExecStart=/etc/rc.d/mysqld start (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/mysqld.service

Anybody have any ideas as to why 'enable' doesn't work?

up vote 18 down vote accepted

mysqld.service is a "virtual" unit – it doesn't exist on the filesystem, it's just part of systemd's compatibility layer. You can start it and systemd will run the legacy /etc/rc.d/mysqld initscript, but you cannot systemctl enable it because you need a real .service file which could be symlinked into the proper place.

You can write such a unit yourself and put it in /etc/systemd/system/mysqld.service:

Description=MySQL Server

ExecStart=/usr/bin/mysqld --defaults-file=/etc/mysql/my.cnf --datadir=/var/lib/mysql --socket=/var/run/mysqld/mysqld.sock


Run systemctl daemon-reload after creating/modifying.

Alternatively, you can install the initscripts-systemd package, which includes arch-daemons.target for automatically starting services defined in rc.conf. However, this package might go away soon, and it's always better to have native configuration files for the init system in use.

  • Thanks! I actually wrote my own mysqld.service that resembles this very closely yesterday, but passes through to /etc/rc.d/mysqld start/stop for ExecStart/ExecStop. Accepted, will post my version up also in case somebody else finds it! Thanks – Rudi Visser Feb 1 '12 at 8:17

@Grawity's answer is correct and probably better than this, but I did get it solved yesterday basically by passing through to the rc.d script...


Description=MySQL Server

ExecStart=/etc/rc.d/mysqld start
ExecStop=/etc/rc.d/mysqld stop


Nota bene: Remember to put host-specific unit files under /etc/systemd/system/ and NOT /lib/systemd/system/.

The latter is for distro-specific stuff; the former is for host-specific stuff that you configure yourself. It's like /usr/bin/ vs. /usr/local/bin/, respectively.

So unless a package installs unit files by itself (under /lib/systemd/system/), put your own "custom" stuff under /etc/systemd/system/.

  • 1
    This doesn't really answer his question. This looks more like a comment to @Rudi's answer. – PhilT Nov 23 '14 at 22:54

Enable is to activate "unit" aka daemon aka service at startup of systemd.


# systemctl list-units --all | grep sql
mysql.service             loaded inactive dead          LSB: Start the MySQL database 

# systemctl enable mysql.service
mysql.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mysql on
insserv: Service localfs has to exists for service vmware-USBArbitrator
insserv: Service network is missed in the runlevels 2 to use service vmware
Warning: unit files do not carry install information. No operation executed.

(it actually redirects to old chkconfig/sysvinit and that corrects init databases)

# systemctl start mysql.service

(no output)

# systemctl status mysql.service
mysql.service - LSB: Start the MySQL database server
          Loaded: loaded (/etc/init.d/mysql)
          Active: active (running) since Tue, 31 Jan 2012 20:07:52 +0100; 5s ago
         Process: 999999 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/mysql.service
                  ├ 999999 /bin/sh /usr/bin/mysqld_safe --mysqld=mysqld --user=mysql...
                  └ 999999 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql...

(sort of runs)
  • Yes I understand this, and mysqld is a daemon/service that I want to run at startup. This is my point, it starts/stops, but won't "enable". – Rudi Visser Jan 31 '12 at 15:58

On my FC15 system, when I ran 'systemctl enable mysqld.service', it automagically came back with:

mysqld.service is not a native service, redirecting to /sbin/chkconfig. Executing /sbin/chkconfig mysqld on

So try running: /sbin/chkconfig mysqld on

If you've got ... when enabling your service unit, copy it to /etc/systemd/system

Failed to issue method call: No such file or directory

To enable your service unit, add below the ... so you can system enable mysqld.service (its enable in every user's namespace)


Cheers, sugatang itlog

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.