当服务已经启动时“systemctl start service”

use*_*379 4 debian start systemctl apache2

我,systemctl start apache2在服务已经启动的情况下运行(或其他服务)时会发生什么?

apache2服务一天启动几百次会不会有问题?(防止服务关闭)或者它会使用内存还是危险?

Mic*_*ton 5

你为什么不只是systemctl is-active用来检查它是否正在运行?

例如:

systemctl is-active --quiet apache2 || systemctl start apache2
Run Code Online (Sandbox Code Playgroud)