例如在KylinV10操作系统中开机自启动depmod -a#创建服务单元 vi /etc/systemd/system/depmod.service #写入配置 [Unit] DescriptionRun depmod at boot Aftersystemd-modules-load.service [Service] Typeoneshot ExecStart/sbin/depmod -a [Install] WantedBymulti-user.target # 重载systemd配置 systemctl daemon-reload # 设置开机启用 systemctl enable depmod.service # 立即测试执行一次 systemctl start depmod.service # 查看运行状态 systemctl status depmod.service