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

imperilaguy

New Member
Joined
Jan 17, 2019
Messages
1
Reaction score
0
Credits
0
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:

[[email protected] system]# systemctl --root=/myservices/mds start xyz.service
Failed to get D-Bus connection: Operation not permitted


The above command is run as root.

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

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.
 
Last edited:


wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,410
Reaction score
7,334
Credits
33,623
G'day @imperilaguy and welcome to linux.org :)

CentOS is not in my repertoire, but there are others here whom can likely assist.

A question, though - when you are Root, sudo is not required, have you tried it without?

Chris Turner
wizardfromoz
 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com

Staff online

Members online


Top