首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何停止系统-失去和不被激活以后?

如何停止系统-失去和不被激活以后?
EN

Unix & Linux用户
提问于 2017-06-05 06:34:54
回答 2查看 14.6K关注 0票数 4

我想知道如何停止系统-logind,而不是重新启动或激活以后?

我知道systemd服务单元文件有一个参数: restart=,当设置它的值为no或on-failure时,像systemctl stop xxx一样停止该服务,并且该服务不会被重新启动或激活。

但是系统-洛金看起来很特殊吗?我有点困惑

代码语言:javascript
复制
I #systemctl cat systemd-logind
# /usr/lib/systemd/system/systemd-logind.service
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Login Service
Documentation=man:systemd-logind.service(8) man:logind.conf(5)
Documentation=http://www.freedesktop.org/wiki/Software/systemd/logind
Documentation=http://www.freedesktop.org/wiki/Software/systemd/multiseat
Wants=user.slice
After=nss-user-lookup.target user.slice

# Ask for the dbus socket. If running over kdbus, the socket will
# not be actually used.
Wants=dbus.socket
After=dbus.socket

[Service]
ExecStart=/usr/lib/systemd/systemd-logind
Restart=no
RestartSec=0
#BusName=org.freedesktop.login1
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_MAC_ADMIN CAP_AUDIT_CONTROL CAP_CHOWN CAP_KILL CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_FOWNER CAP_SYS_TTY_CONFIG
WatchdogSec=1min

# Increase the default a bit in order to allow many simultaneous
# logins since we keep one fd open per session.
LimitNOFILE=16384
EN

回答 2

Unix & Linux用户

发布于 2017-06-05 07:27:42

要停止激活服务,正确的命令是systemctl mask ...。这也将防止它在启动时启动。

如果您只想防止当前启动它,请使用systemctl mask --runtime。这意味着当您关闭或重新启动时,该设置将被遗忘。

logind是非常重要的,我预计会中断引导或登录--手头有一个救援磁盘,并知道如何使用它:)。

票数 7
EN

Unix & Linux用户

发布于 2017-12-02 14:06:55

要禁用系统d-logind,您必须屏蔽服务并禁用systemd模块(pam_systemd)。您可以使用以下命令来完成此操作:

systemctl mask systemd-logind.service pam-auth-update

这是相当安全的,我已经做了很多年。

票数 3
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/369247

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档