This is a follow up question to Disable all services, except ssh. I want to achieve the same thing on CentOS 7 but I'm having trouble getting it to work.
I've created /usr/lib/systemd/system/maintenance.target and the contents are as follows:
[Unit]
Description=Maintenance Mode with Networking and SSH
Requires=maintenance.target systemd-networkd.service sshd.service
After=maintenance.target systemd-networkd.service sshd.service
AllowIsolate=yes
But when I run systemctl isolate maintenance.target
I get:
Failed to start maintenance.target: Unit not found.
Not sure where to go from here. Any ideas? By the way, the purpose of this is to be able to run an clone of a live server to a new one with the minimum of downtime. Previously I've just been stopping all services manually but I'd like a more "catch all" approach.
0 Answers