文章摘要
这篇文章介绍了`systemd`中一个名为`rc-local`的单位配置文件的设置。它遵循LGPL-2.1协议,说明`systemd`作为自由软件的 redistributable 和可修改性。文章描述了`rc-local`文件如何通过`multi-user.target`自动加载,配置包括`Description`、`Documentation`、`ConditionFileIsExecutable`、`After`等部分。此外,文章还提到该服务类型为`fork`,执行`start`命令,设置`TimeoutSec=0`、`RemainAfterExit=yes`和`GuessMainPID=no`。最后,说明`rc-local`的安装由`multi-user.target`负责管理。
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
[Install]
WantedBy=multi-user.target
© 版权声明
文章版权归作者所有,未经允许请勿转载。