systemd笔记

systemd笔记

基本操作

○ Starting a unit
■ systemctl start sshd.service
○ Stopping a unit
■ systemctl stop sshd.service
○ Restarting a unit
■ systemctl restart sshd.service
○ Enable a unit to start at boot
■ systemctl enable sshd.service
○ Disabling service so it does not run at boot
■ systemctl disable sshd.service
○ Displaying the contents of a unit file
■ systemctl cat sshd.service
○ systemctl status is used to get information about a unit
■ systemctl status sshd.service

ACPI支持

Edit /etc/systemd/logind.conf (or systemd-logind.conf, depending on the
distro) and set the following parameters:
○ HandlePowerKey – Power off system when power button is pressed
○ HandleSleepKey – Suspend system when sleep key is pressed
○ HandleLidSwitch – Suspend system when laptop lid is closed

Run man logind.conf for more information on valid values for the above
parameters
● You'll need to restart systemd-logind.service for changes to this config file to
take effect

Full-fledged desktop environments such as GNOME, KDE, XFCE, etc. (which
have their own ACPI handlers) will not require this file to be configured, and will
likely have a GUI to configure ACPI event-handling
● Configuring systemd-logind is more helpful for users of tiling window managers
with no desktop environment

● Sleep (Suspend to RAM)
○ systemctl suspend
● Hibernate (Suspend to Disk)
○ systemctl hibernate
● /sbin/shutdown tasks
○ Reboot
■ systemctl reboot
○ Halt System (without powering off)
■ systemctl halt
○ Power Off System
■ systemctl poweroff
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值