Problem with systemctl --root= option in RHEL/CentOS 7

Issues related to applications and software problems
Post Reply
imperialguy
Posts: 1
Joined: 2019/01/17 12:17:29

Problem with systemctl --root= option in RHEL/CentOS 7

Post by imperialguy » 2019/01/17 12:23:25

It is my understanding that --root= option in systemctl command is used to explicitly specify an alternate root path to find the service unit files.

On RHEL/CentOS 7, the following error occurs when attempting to use the above mentioned systemctl option:

Code: Select all

[root@server-02 system]# systemctl --root=/myservices/mds start xyz.service
Failed to get D-Bus connection: Operation not permitted
So, the idea behind the above command is that I am telling systemctl to find the service called xyz.service in the path /myservices/mds, as opposed to the default search paths like /etc/systemd/system or /run/systemd/system

Does anyone have any idea why this is not working? If --root is not going to work, is there any other way to specify a custom search path?

Would really appreciate the help.

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Problem with systemctl --root= option in RHEL/CentOS 7

Post by TrevorH » 2019/01/17 13:01:43

The man page says it works for "enable/disable/is-enabled" and "related commands" whatever they may be.

I'm guessing that for what you're trying to do it needs to talk to dbus via some sort of socket. Perhaps you need to find the socket and symlink the real thing into your --root.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply