Installing cloudflared Service on OpenWrt
openwrt使用cloudflared安装服务的时候会有兼容性问题,问题出现在/etc/init.d/目录下的服务脚本,默认使用的是SysVinit,而cloudflared使用的是procd。所以我们需要修改服务脚本,将其改为procd的格式。
SysVinit 是许多早期 Linux 发行版使用的传统初始化系统。它使用一系列的 shell 脚本,按照特定的顺序启动各种服务。这些脚本通常位于 /etc/init.d/ 目录中,每个脚本对应一个服务。SysVinit 的主要缺点是它启动服务的方式是线性的,不能并行启动,这可能导致启动时间较长。
procd 是 OpenWrt 使用的初始化系统。与 SysVinit 不同,procd 可以并行启动服务,从而加快系统启动时间。procd 还提供了一些其他高级功能,如进程监控、自动重启和 cgroup 管理。procd 的服务脚本通常位于 /etc/init.d/ 目录中,与 SysVinit 类似,但它们的格式和语法有所不同。
修改完/etc/init.d/cloudflared后,使用/etc/init.d/cloudflared restart重启服务即可。
1 | |
When installing the cloudflared service on OpenWrt, compatibility issues may arise due to the service scripts in the /etc/init.d/ directory. By default, these use SysVinit, while cloudflared utilizes procd. Therefore, we need to modify the service script to conform to the procd format.
SysVinit is the traditional init system used by many early Linux distributions. It employs a series of shell scripts that start various services in a specific order. These scripts are typically located in the /etc/init.d/ directory, with each script corresponding to a service. The main drawback of SysVinit is its linear service startup, which prevents parallel execution and can result in longer boot times.
procd is the init system used by OpenWrt. Unlike SysVinit, procd can start services in parallel, thereby speeding up system boot times. procd also offers other advanced features such as process monitoring, automatic restarts, and cgroup management. procd service scripts are also located in the /etc/init.d/ directory, similar to SysVinit, but they differ in format and syntax.
After modifying /etc/init.d/cloudflared, you can restart the service using /etc/init.d/cloudflared restart.
1 | |