无法在 Centos 上注册和启动服务

Could not register service and start it on Centos

我已经在 Centos 7.9 上安装了 Minio 服务器,我正在尝试 运行 它作为一项服务。

我使用本指南及其提供的 minio.service 文件将 Minio 安装为服务:https://www.centosblog.com/install-configure-minio-object-storage-server-centos-linux/

现在,当我尝试启用该服务时,我收到以下错误。有人可以帮忙吗?

[root@danesh bin]# systemctl enable minio.service

** (pkttyagent:38702): WARNING **: 22:50:16.320: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)

正在启动服务:

[root@danesh bin]# systemctl start minio.service

** (pkttyagent:43010): WARNING **: 23:06:46.143: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)
Job for minio.service failed because a configured resource limit was exceeded. See "systemctl status minio.service" and "journalctl -xe" for details.

原来是因为Centos中的“Secure processes”。它应该隐藏所有 Linux 不属于用户的进程。

我有 CWP 控制面板,所以我转到面板的“安全进程”部分并暂时禁用它。启用该服务后,您可以重新启用它。

您必须将 permissive 模式设置为 SELINUX。在命令行中打开以下文件:

sudo vi /etc/selinux/config

然后更改以下值:

SELINUX=permissive

最后,重启 OS:

sudo reboot

启用minio.service后,不要忘记再次将enforcing设置为SELINUX