“systemd --now enable metricbeat.service” 未启动 metricbeat.service

“systemd --now enable metricbeat.service” 未启动 metricbeat.service

我的环境:

# cat /etc/debian_version 
9.8
# uname -a
Linux X 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
# 
# systemctl --version
systemd 232
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN
# 
# metricbeat version
metricbeat version 6.7.1 (amd64), libbeat 6.7.1 [1d55b4bd9dbf106a4ad4bc34fe9ee425d922363b built 2019-04-02 15:11:28 +0000 UTC]
# 

我正在尝试使用systemctl标志--now,但遇到以下问题:

systemctl

# systemctl --now enable metricbeat
Synchronizing state of metricbeat.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable metricbeat
# echo $?
0
# systemctl status metricbeat
● metricbeat.service - Metricbeat is a lightweight shipper for metrics.
   Loaded: loaded (/lib/systemd/system/metricbeat.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: https://www.elastic.co/products/beats/metricbeat
# 

但是,如果/当我仅使用 启动服务时systemctl start,服务将启动:

# systemctl start metricbeat
# echo $?
0
# systemctl status metricbeat
● metricbeat.service - Metricbeat is a lightweight shipper for metrics.
   Loaded: loaded (/lib/systemd/system/metricbeat.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-04-10 20:08:40 UTC; 2s ago
     Docs: https://www.elastic.co/products/beats/metricbeat
 Main PID: 21369 (metricbeat)
    Tasks: 10 (limit: 4915)
   Memory: 9.9M
      CPU: 167ms
   CGroup: /system.slice/metricbeat.service
           └─21369 /usr/share/metricbeat/bin/metricbeat -c /etc/metricbeat/metricbeat.yml -path.home /usr/share/metricbeat -path.config /etc/metricbeat -path.data /var/lib/metricbeat -path.logs /var/log/metricbe

Apr 10 20:08:40 X systemd[1]: Started Metricbeat is a lightweight shipper for metrics..
# 

实际问题:

为什么--now不工作?我做错什么了吗?

相关内容