首页 > 系统相关 >ubuntu 自动休眠 关闭

ubuntu 自动休眠 关闭

时间:2024-02-26 10:33:17浏览次数:16  
标签:10 systemd target 休眠 inactive sleep 关闭 ubuntu tlrobot

ubuntu 自动休眠 关闭

远程连接ubuntu 经常连不上,去机房看是自动关机了原因是之前厂商安装的是桌面版ubuntu ,默认有自动休眠,不用自动就休眠了。

 

查看是否开启了自动休眠。

sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target

 

是的话会显示 enabled

● sleep.target - Sleep
    Loaded: loaded (/lib/systemd/system/sleep.target; static; vendor preset: enabled)
    Active: inactive (dead) since Mon 2024-02-26 10:10:47 CST; 1min 56s ago
      Docs: man:systemd.special(7)

2月 22 17:49:49 tlrobot-pc systemd[1]: Reached target Sleep.
2月 26 10:10:47 tlrobot-pc systemd[1]: Stopped target Sleep.

● suspend.target - Suspend
    Loaded: loaded (/lib/systemd/system/suspend.target; static; vendor preset: enabled)
    Active: inactive (dead)
      Docs: man:systemd.special(7)

2月 26 10:10:47 tlrobot-pc systemd[1]: Reached target Suspend.
2月 26 10:10:47 tlrobot-pc systemd[1]: Stopped target Suspend.

● hibernate.target - Hibernate
    Loaded: loaded (/lib/systemd/system/hibernate.target; static; vendor preset: enabled)
    Active: inactive (dead)
      Docs: man:systemd.special(7)

● hybrid-sleep.target - Hybrid Suspend+Hibernate
    Loaded: loaded (/lib/systemd/system/hybrid-sleep.target; static; vendor preset: enabled)
    Active: inactive (dead)
      Docs: man:systemd.special(7)

 

关闭自动休眠

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target


Created symlink /etc/systemd/system/sleep.target → /dev/null.
Created symlink /etc/systemd/system/suspend.target → /dev/null.
Created symlink /etc/systemd/system/hibernate.target → /dev/null.
Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.

ps:systemctl mask 命令用于屏蔽(禁用)指定的系统单元,使其无法被启动。

 

重新查看

sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target

● sleep.target
    Loaded: masked (Reason: Unit sleep.target is masked.)
    Active: inactive (dead) since Mon 2024-02-26 10:10:47 CST; 6min ago

2月 22 17:49:49 tlrobot-pc systemd[1]: Reached target Sleep.
2月 26 10:10:47 tlrobot-pc systemd[1]: Stopped target Sleep.

● suspend.target
    Loaded: masked (Reason: Unit suspend.target is masked.)
    Active: inactive (dead)

2月 26 10:10:47 tlrobot-pc systemd[1]: Reached target Suspend.
2月 26 10:10:47 tlrobot-pc systemd[1]: Stopped target Suspend.

● hibernate.target
    Loaded: masked (Reason: Unit hibernate.target is masked.)
    Active: inactive (dead)

● hybrid-sleep.target
    Loaded: masked (Reason: Unit hybrid-sleep.target is masked.)
    Active: inactive (dead)

自动休眠已经被关闭

 

标签:10,systemd,target,休眠,inactive,sleep,关闭,ubuntu,tlrobot
From: https://www.cnblogs.com/renoyuan/p/18033783

相关文章

  • 关闭Windows网络连接状态指示器的活动测试 注册表 REG
    REG文件来关闭Windows网络连接状态指示器的活动测试:CopyCodeWindowsRegistryEditorVersion5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet]"EnableActiveProbing"=dword:00000000该文件将向注册表添加一个名为"EnableActivePr......
  • Ubuntu22.04安装mysql8数据库
    1、去官网下载APT存储库文件2、到/usr/local目录下创建mysql目录并且用rz命令上传下载的文件若没有安装lrzsz自行安装。3、解压下载的文件)直接选择OK4、更新包信息5、安装设置初始密码选第二个选项6、登录数据库......
  • VMware Workstation 安装Ubuntu虚拟机 屏幕窗口分辨率 自动调整大小 自动适应客户机
    Ubuntu18.04.5LTSVMwareWorkstation16Pro 首先排查了vmwaretools的安装问题首先尝试通过这样安装 点击安装后,好像是有个cd挂载上,复制这个文件到桌面解压这个压缩包,在文件夹打开终端sudo./vmware-install.pl全按回车应该就可以其间Theinstallerhasdetect......
  • Ubuntu20.04 系统 ALERT! UUID=xxx does not exist. Dropping to a shell!
    Gaveupwaitingforrootdevice.Commonproblems:-Bootargs(cat/proc/cmdline)-Checkrootdelay=(didthesystemwaitlongenough?)-Missingmodules(cat/proc/modules;ls/dev)ALERT!UUID=718ed077-947d-4018-80ad-59825678e81ddoesnotexist.Dropping......
  • linux(ubuntu22.04)+PicGo(gui版)+阿里云oss搭建图床教程
    linux(ubuntu22.04)+PicGo(gui版)+阿里云oss搭建图床教程资源库PicGo下载链接:山东镜像源github原版阿里云oss链接linux下PicGo(gui版)的安装从资源库链接里下载后缀为.AppImage的安装包,版本可以选择稳定版2.3.1也可以用更新的beta版。修改文件权限,打开文......
  • SeaTunnel Web 在Ubuntu环境的安装
    SeaTunnelWeb在Ubuntu环境的安装目录SeaTunnelWeb在Ubuntu环境的安装下载软件测试SeaTunnel任务下载连接器启动客户端模式配置web元数据库配置Web应用配置JAVA_HOME配置SEATUNNEL_HOME添加MySQL驱动添加连接器到Web启动服务页面测试下载软件下载SeaTunnel二进制文件下载......
  • ubuntu 安装mysql
    1.dpkg--list|grepmysql命令可以查看当前系统是否已有mysql的相关包;同时该命令也可用于装完mysql之后的检查:ubuntu18.04的版本对应的默认的mysql的版本还是5.7。。 不过无所谓。 2.安装完之后,默认mysql的进程就是启动着的,可以使用 netstat-tap|grepmysql命令查......
  • Ubuntu中出现大量SYN_SENT连接—work32病毒查杀
    查看网络连接#查看网络连接及使用的端口netstat-ant-p我们可以看到服务器想很多陌生ip发送连接,都是通过这个work32进程。查看进程#查看并过滤指定进程ps-aux|grepwork32关闭进程,删除源文件这里我们可以看到这个进程文件的路径,我们先将这个进程杀掉,然后进到这......
  • Ubuntu安装代码检查工具
    Ubuntu安装代码检查工具shellcheck安装:sudoapt-getinstallshellcheck用法:shellcheck./*.shluacheck安装:sudoapt-getinstalllua-check用法:luacheck./*.luacppcheck安装:sudoapt-getinstallcppcheck用法:cppcheck./*.c;cppcheck./*.cpp......
  • ubuntu server 22.04.2 LTS安装流程
    1、下载Ubuntu镜像下载地址:清华大学开源软件镜像站 选择Ubuntu版本22.04.XX(amd64,Server),其中XX小版本自选(当前示例版本为22.04.2)。 2、本地加载Ubuntu的iso镜像默认选中「TryorInstallUbuntuServer」安装选项,回车(或等待30秒后),等待系统镜像自检并进行安装初始化......