4

Fairly stock standard Fedora 30 install:

$ 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)

I have installed grafana using standard instructions, ie. add grafana rpm repo and then sudo dnf install grafana.

I can manually start and use grafana without issue using sudo systemctl start grafana-server. I cannot, however, get it to start on boot.

Here's what happens when I use the commonly recommended method:

$ 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 is indeed missing:

$ 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

Apparently systemd-sysv-install is supposed to be a symlink to chkconfig on Fedora. So is it Fedora, grafana or systemd's responsibility to decide which tool is responsible for installing the boot script for non-native services? And therefore who is responsible for providing the missing link?

I see anaconda had the same drama with the network service.

1 Answer 1

7

The power of rubber-ducking the question shines again! Sure enough, installing chkconfig manually resolves my original issue:

$ 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.

So unless anyone has a better answer, the best I can come up with is that the systemd install on Fedora 30 is incomplete. You must also install chkconfig.

6
  • 1
    "systemd install on Fedora 30 is incomplete." No, that's not quite correct. "You must also install chkconfig." Only if you want/need to manage a legacy startup script, also known as sysv init script, one that lives in /etc/init.d/grafana rather than /etc/systemd/system/grafana.service, and needs systemd generator (systemd-sysv-install) to generate a native unit to interface to it. In short, the issue is with Grafana, which should be shipping a systemd unit, or at least should add a dependency on chkconfig to pull it automatically.
    – filbranden
    Aug 9, 2019 at 6:05
  • That doesn't quite make sense to me - how is Grafana to know that chkconfig is necessary? It seems to be systemctl (which is part of systemd, right?) that is invoking systemd-sysv-install (which sounds like it's part of systemd). Why should Grafana care about how systemd handles legacy init scripts? Aug 9, 2019 at 6:23
  • 3
    1) chkconfig is what manages sysv init scripts, if Grafana is shipping one, it does make sense for it to add a dependency on chkconfig. 2) systemd-sysv-install is part of systemd, but distros such as Fedora have decided to stop shipping it by default because all the packages in their own repos have been converted to use native systemd units. 3) Fedora decided to ship systemd-sysv-install together with chkconfig because they expected packages that ship legacy init scripts would depend on it and end up pulling it. I hope that's at least a bit clearer to you now.
    – filbranden
    Aug 9, 2019 at 6:32
  • I understand that, from your point of view, this just looks broken and you want to fix it... I'm just saying it's inaccurate to say Fedora is shipping an incomplete systemd install, since that's far from the truth. The decision not to ship systemd-sysv-install by default is a very deliberate one, and it's a decision made to help push third-parties (such as Grafana) to start shipping native systemd units instead (in which case, nothing would have been broken for you.) I hope this explanation helps you!
    – filbranden
    Aug 9, 2019 at 6:34
  • Ah, much clearer thank you. Since (1) is not true on other distributions and (2) is Fedora's choice and (3) is a breaking change, I can see how it's a "push" to get third-parties to change their ways. Once again, the user is caught in the middle of this update war. Aug 9, 2019 at 23:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.