speed up li off and systemctl
2018-01-31 00:05
447 查看
systemctl list-units --type=service 显示所有已启动的服务 systemctl list-unit-files --type=service | grep enabled 列出开机启动项centos有chkconfig ubuntu有类似的sysv-conf但用sysv-conf禁用后用systemctrl还是有的能够启动 好像是最新的命令chkconfig service等都合并为systemctrl了 systemctrl为systemd的一个工具就如ifconfig和ip新旧命令 http://blog.csdn.net/example440982/article/details/51794440 systemctrl介绍 systemctl命令是系统服务管理器指令,它实际上将 service和 chkconfig 这两个命令组合到一起。停用的服务进程仍然能够被另外一个服务进程启动。如果你真的想在任何情况下系统启动时都不启动该进程,无需卸载该它,只需要把它掩盖起来就可以阻止该进程在任何情况下开机启动。
$ sudo systemctl mask bluetooth.service
Created symlink from /etc/systemd/system/bluetooth.service to /dev/null.
sudo systemctl unmask bluetooth.service后重启比如vm关掉不能运行
一旦你对禁用该进程启动而没有出现负面作用感到满意,你也可以选择卸载该程序。
这里举例了几个服务进程的作用。许多服务进程都是发行版特定的,所以你应该看看你的发行版文档(比如通过 google 或 StackOverflow)。
accounts-daemon.service 是一个潜在的安全风险。它是 AccountsService 的一部分,AccountsService 允许程序获得或操作用户账户信息。我不认为有好的理由能使我允许这样的后台操作,所以我选择掩盖mask该服务进程。
avahi-daemon.service 用于零配置网络发现,使电脑超容易发现网络中打印机或其他的主机,我总是禁用它,别漏掉它。
brltty.service 提供布莱叶盲文设备支持,例如布莱叶盲文显示器。
debug-shell.service 开放了一个巨大的安全漏洞(该服务提供了一个无密码的 root shell ,用于帮助 调试 systemd 问题),除非你正在使用该服务,否则永远不要启动服务。
ModemManager.service 该服务是一个被 dbus 激活的守护进程,用于提供移动宽频broadband(2G/3G/4G)接口,如果你没有该接口,无论是内置接口,还是通过如蓝牙配对的电话,以及 USB 适配器,那么你也无需该服务。
pppd-dns.service 是一个计算机发展的遗物,如果你使用拨号接入互联网的话,保留它,否则你不需要它。
rtkit-daemon.service 听起来很可怕,听起来像是 rootkit。 但是你需要该服务,因为它是一个实时内核调度器real-time kernel scheduler。
whoopsie.service 是 Ubuntu 错误报告服务。它用于收集 Ubuntu 系统崩溃报告,并发送报告到 https://daisy.ubuntu.com 。 你可以放心地禁止其启动,或者永久的卸载它。
wpa_supplicant.service[/b] 仅在你使用 Wi-Fi 连接时需要。
那么如何找出拖慢开机速度的元凶并将其禁用呢?
systemd自带分析利器systemd-analyze
systemd-analyze有一些参数,大体上来讲就是一些功能, 可以用man systemd-analyze其中, 对我们比较有用的参数就是blame。
blame : blame是"指责"的意思。
同理, systemd-analyze blame就是显示开机启动项的时间, 从最慢依次列出。
然后有选择的禁用切忌不要把系统核心的给禁用了,
systemctrl disable xxx但有的无法disable只能用mask了也就是说 mask 选项把 service 直接软链接到了 /dev/null 这个著名的「黑洞」中去了,然后世界就清净了。
开机不检查磁盘,vi /etc/fstab 把/dev/sda2的0 1 改为0 0
任务 | 旧指令 | 新指令 |
使某服务自动启动 | chkconfig --level 3 httpd on | systemctl enable httpd.service |
使某服务不自动启动 | chkconfig --level 3 httpd off | systemctl disable httpd.service |
检查服务状态 | service httpd status | systemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active) |
显示所有已启动的服务 | chkconfig --list | systemctl list-units --type=service |
启动某服务 | service httpd start | systemctl start httpd.service |
停止某服务 | service httpd stop | systemctl stop httpd.service |
重启某服务 | service httpd restart | systemctl restart httpd.service |
相关文章推荐
- nginx启动报错:Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' fo
- TensorFlow问题:The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
- Job for postfix.service failed. See 'systemctl status postfix.service' and 'journalctl -xn' for deta
- New eXtremeDB Financial Edition Version 6.0 Ramps Up Database System's Speed, Scalability and Develo
- [systemd]How To Use Systemctl to Manage Systemd Services and Units
- How to set up a link betwteen a real Android cell and Ubuntu System by adb
- Back Up and Restore with Filesystem Snapshots
- Jenkins 安装启动提示“iJob for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.”
- 系统优化加速:360 Amigro System Speedup 1.2.1.3300 专业版
- How to Clean Up Duplicate Objects Owned by SYS and SYSTEM Schema (Doc ID 1030426.6)
- Renewed Red Hat and updated the system with yum up
- TensorFlow问题“The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.”
- Start-up of Dual System Windows and Linux
- Cleaning up the system – 11i and R12
- ubuntu systemctl generated and enabled
- Matrix and linear algebra in F#, Part IV: profile your program, find the bottleneck and speed it up: using matrix multiplication as an example[z]
- 5 Tips To Speed Up Linux Software Raid Rebuilding And Re-syncing
- How to speed up and smooth over any load times on iPhone (preloading, animated loading screens etc)
- C#: how do I list all System defined Exceptions and pick up what I need
- Activity starting window and how to speed up activity starting (Android 7.0)