See system logs and 'systemctl status' for detailsrtdp@linux-vai9:~> systemctl status apache2-k start (code=exited, status=1/FAILURE)即使我试图声明ngnix,它也会产生错误,因为-
rtdp@linux-vai9:~> sudo
该脚本在systemctl上运行良好,但在没有安装systemctl的情况下失败。作为替代,我使用service命令进行检查,但是这样做,我无法对grep特定的服务运行grep命令。这个脚本需要在多台linux机器上运行(有些带有systemctl,有些没有)。如能提供任何帮助,将不胜感激。#!/bin/bash
if (systemctl --all --type service || service --status-all)