无法在 Fedora 中启动时启用 grafana,因为缺少 systemd-sysv-install

无法在 Fedora 中启动时启用 grafana,因为缺少 systemd-sysv-install

相当标准的 Fedora 30 安装:

$ uname -a
Linux <redacted> 5.1.16-300.fc30.x86_64 #1 SMP Wed Jul 3 15:06:51 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/fedora-release 
Fedora release 30 (Thirty)

我已grafana使用标准说明安装,即。添加grafana rpm repo,然后sudo dnf install grafana

我可以手动启动和使用 grafana,而不会出现问题sudo systemctl start grafana-server。但是,我无法让它在启动时启动。

当我使用通常推荐的方法时,会发生以下情况:

$ sudo systemctl enable grafana-server
Synchronizing state of grafana-server.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable grafana-server
Failed to execute /usr/lib/systemd/systemd-sysv-install: No such file or directory

systemd-sysv-install确实缺少:

$ ls /usr/lib/systemd/
boot                      systemd-bless-boot              systemd-journald              systemd-rfkill            systemd-user-sessions
catalog                   systemd-bootchart               systemd-localed               systemd-shutdown          systemd-vconsole-setup
libsystemd-shared-241.so  systemd-boot-check-no-failures  systemd-logind                systemd-sleep             systemd-veritysetup
network                   systemd-cgroups-agent           systemd-makefs                systemd-socket-proxyd     systemd-volatile-root
ntp-units.d               systemd-coredump                systemd-modules-load          systemd-sulogin-shell     system-generators
portable                  systemd-cryptsetup              systemd-networkd              systemd-sysctl            system-preset
purge-nobody-user         systemd-dissect                 systemd-networkd-wait-online  systemd-timedated         system-shutdown
resolv.conf               systemd-export                  systemd-portabled             systemd-timesyncd         system-sleep
system                    systemd-fsck                    systemd-quotacheck            systemd-time-wait-sync    user
systemd                   systemd-growfs                  systemd-random-seed           systemd-udevd             user-environment-generators
systemd-ac-power          systemd-hibernate-resume        systemd-remount-fs            systemd-update-done       user-generators
systemd-backlight         systemd-hostnamed               systemd-reply-password        systemd-update-utmp       user-preset
systemd-binfmt            systemd-initctl                 systemd-resolved              systemd-user-runtime-dir

显然systemd-sysv-install应该是chkconfigFedora 上的符号链接。那么决定哪个工具负责安装非原生服务的启动脚本是Fedora、grafana还是systemd的责任呢?那么谁负责提供缺失的环节呢?

我懂了蟒蛇服务也有同样的戏剧性network

答案1

橡皮鸭回避问题的力量再次闪耀!果然,chkconfig手动安装解决了我原来的问题:

$ sudo dnf install chkconfig -y
$ sudo systemctl enable grafana-server
Synchronizing state of grafana-server.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable grafana-server
Created symlink /etc/systemd/system/multi-user.target.wants/grafana-server.service → /usr/lib/systemd/system/grafana-server.service.

因此,除非有人有更好的答案,否则我能想到的最好答案是systemdFedora 30 上的安装不完整。您还必须安装chkconfig.

相关内容