systemctl enable コマンドで Failed to execute operation: Invalid argument が出た
環境
CentOS 7.3
現象
# systemctl enable サービス名 Failed to execute operation: Invalid argument
原因
systemctl enable
コマンドで /etc/systemd/system/multi-user.target.wants/サービス名.service
にシンボリックリンクが張られるが、間違えてファイルの実体をコピーしてしまっていた。
対処
/etc/systemd/system/multi-user.target.wants/サービス名.service
を削除してあらためて systemctl enable
すればよい。
もちろん、このファイルを編集してしまっている場合は、元ファイルに適用してから操作する。