Linux--由笔记本合盖不休眠探究logind.conf配置

问题:当我们想合上笔记本盖子,它默认会休眠,我们想修改它的默认操作?


    #  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.
    #
    # Entries in this file show the compile time defaults.
    # You can change settings by editing this file.
    # Defaults can be restored by simply deleting this file.
    #
    # See logind.conf(5) for details.

    [Login]
    #NAutoVTs=6
    #ReserveVT=6
    #KillUserProcesses=no
    #KillOnlyUsers=
    #KillExcludeUsers=root
    #InhibitDelayMaxSec=5
    #HandlePowerKey=poweroff
    #HandleSuspendKey=suspend
    #HandleHibernateKey=hibernate
    HandleLidSwitch=lock
    #HandleLidSwitchDocked=ignore
    #PowerKeyIgnoreInhibited=no
    #SuspendKeyIgnoreInhibited=no
    #HibernateKeyIgnoreInhibited=no
    #LidSwitchIgnoreInhibited=yes
    #HoldoffTimeoutSec=30s
    #IdleAction=ignore
    #IdleActionSec=30min
    #RuntimeDirectorySize=10%
    #RemoveIPC=yes
    #UserTasksMax=12288
  • NAutoVTs 配置分配的虚拟终端(VT)数量,默认6个,取值为正整数
  • ReserveVConfigures whether the processes of a user should be killed when the user logs out.T标识一个无条件保留用于autovt @ .service激活的虚拟终端(与NAutoVTs有关)
  • KillUserProcesses取值为布尔值,配置用户注销时是否结束该用户的进程,取0则进程不会被杀死
  • KillOnlyUsers设置进程被杀死的用户
  • KillExcludeUsers设置不被杀死进程的用户,如果没设置,默认root用户的进程不被杀死
  • IdleAction配置系统空闲时要采取的操作
    可选项:ignore/poweroff/reboot/halt/kexec/suspend/hibernate/hybrid-sleep/suspend-then-hibernate/lock,默认为lock
  • IdleActionSec配置系统空闲多长时间后采取操作
  • InhibitDelayMaxSec指定系统关闭或睡眠请求延迟的最长时间,默认为5秒
  • HandlePowerKey为电源操作,默认关机,可选项如上,lock为屏幕锁定,并不会休眠
  • HandleLidSwitch如果不想合盖休眠,且不想屏幕锁定和休眠,设置为ignore
  • HandleLidSwitchDocked如果有扩展坞,即用来扩展笔记本电脑功能的底座,通过接口和插槽连接多种外部设备。可选项如上
  • PowerKeyIgnoreInhibited、SuspendKeyIgnoreInhibited、HibernateKeyIgnoreInhibited、LidSwitchIgnoreInhibited:控制当触发电源和睡眠键以及盖子开关时systemd-logind采取的操作是否受到高级别抑制器锁定,低级别的inhibitor locks始终有效,无视此设置
  • HoldoffTimeoutSec指定系统启动或系统恢复后的超时,systemd将在响应盖子事件时暂停。
  • RuntimeDirectorySize为每个登录用户设置$ XDG_RUNTIME_DIR运行时目录的大小限制。
  • InhibitorsMax控制允许的最大并发inhibitor数量。 默认为8192(8K)。
  • SessionsMax控制要管理的最大并发用户会话数
  • RemoveIPC控制用户完全注销时是否应删除属于该用户的System V和POSIX IPC对象,取值为布尔
  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值