首页 > 其他 > 详细

systemd管理开机自启动

时间:2020-06-29 10:44:37      阅读:99      评论:0      收藏:0      [点我收藏+]

Using a separate service
Tip: These steps can be automated by installing the systemd-numlockonttyAUR package and enabling the numLockOnTty service.

First create a script to set the numlock on relevant TTYs:

/usr/local/bin/numlock

#!/bin/bash

for tty in /dev/tty{1..6}
do
    /usr/bin/setleds -D +num < "$tty";
done

Once the script is created, you will need to make it executable. Otherwise the script cannot run.

Then create and enable a systemd service:

/etc/systemd/system/numlock.service

[Unit]
Description=numlock

[Service]
ExecStart=/usr/local/bin/numlock
StandardInput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

systemd管理开机自启动

原文:https://www.cnblogs.com/DXGG-Bond/p/13206426.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!