简体   繁体   English

Linux SystemD服务-简单vs分叉-缺点?

[英]Linux SystemD Services - Simple vs Forked - Downsides?

A lot of programs you download can be run in a blocking manner or in the background (usually by start/stop/etc commands). 您下载的许多程序都可以以阻止方式或在后台运行(通常通过启动/停止/等命令)。 Some good examples are HA Proxy and Spring Boot apps built to be Linux services... both can be run in either manner. HA Proxy和Spring Boot应用程序已构建为Linux服务,这是一个很好的例子……两者都可以以任何一种方式运行。

In system-d unit files you can use "forked" type to allow you to map to start/stop/etc commands for managing a program that runs in the background/as a daemon. 在system-d单元文件中,您可以使用“ forked”类型来映射到启动/停止/ etc命令,以管理在后台/作为守护程序运行的程序。 Alternatively, you can just use the "simple" type and call the app itself in a blocking manner. 或者,您可以只使用“简单”类型并以阻止方式调用应用程序本身。

Is there any particular reason to prefer "forked" where it is an option? 在有选择的情况下,有什么特别的理由偏爱“分叉”吗? Having done both options on numerous things, it seems "simple" is lighter on config and more obvious in terms of usage. 在很多事情上都做完这两个选项之后,“简单”在配置上显得更轻便,在用法上也更加明显。

这可以在https://www.freedesktop.org/software/systemd/man/daemon.html “ sysv守护程序”部分中得到解答,选择“分叉”方法主要只有缺点,因为那里的大多数软件都不会执行“ 15个步骤”是正确地还是根本没有,特别是很少正确地执行步骤12和14。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM