我习惯于使用systemd创建和使用服务,就像这样:
XXXX.service:
[Unit]
Description=Report Service
[Service]
Type=Simple
ExecStart=/path/to/my/script.shXXXX.timer:
[Unit]
Description=Timer for Report Service
[Timer]
OnCalendar=*-*-* 2:00:00
Persistent=true
[Install]
WantedBy=timers.target但是现在,我不得不使用OpenRC,我真的不明白它是如何工作的!
有人解释了OpenRC是如何工作的,并根据我的例子,如何使用OpenRC创建服务,以便学习如何使用它?
非常感谢!
发布于 2021-02-16 04:51:11
也许学习this是最好的选择。
基本脚本如下所示:
#!/sbin/openrc-run
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
name="service"
description=""
command="/path/to/dir/"
command_args="${service_args}"
#command_user="user:user"
depend() {
}https://stackoverflow.com/questions/65942607
复制相似问题