Lebear
If you don't like the world, create one instead of complaining.

Linux:添加开关机蜂鸣器提示

2020-03-11 Linux
Word count: 157 | Reading time: 1min

应用:Linux服务器在没有音频输出和显示输出的情况下,利用蜂鸣器可以快速判断启动状况。

添加systemd服务:

# /etc/systemd/system/beep-up.service

[Unit]
Description=Beep after system start
DefaultDependencies=no
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/usr/bin/beep -f 3000 -l 100 -n -f 3500 -l 100 -r 2

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/beep-down.service

[Unit]
Description=Beep before system shutdown
DefaultDependencies=no
Before=exit.target

[Service]
Type=oneshot
ExecStart=/usr/bin/beep -f 3000 -l 100 -r 2 -n -f 2000 -l 150

[Install]
WantedBy=reboot.target halt.target poweroff.target

最后启用 beep-up.service 和 beep-down.service

Author: Leisurelybear

Link: https://blog.lebear.top/2020/03/11/136/

Copyright: Copyright © 2019-2022 LeisurelyBear All rights reserved.

< PreviousPost
Spring MVC源码分析(一):处理前端请求doDispatch()以及getHandler()方法细节
NextPost >
剑指offer:字符串的排列(划分子问题)
CATALOG