systemd starts zfs-import-cache before al Harddisks are "online" after reboot

kleemann_hdm_str

New Member
Nov 7, 2024
5
0
1
Hallo zusammen,

ich brauche mal eure Hilfe. Ich habe hier einenn Proxmox HA Cluster (backup),
wo der zfs-import-cache vom systemd gestartet wird, bevor alle Festplatten "online" sind, was einen neustart der Maschine erfordert. Bisher haben wir das so gelöst, daß wir nach dem Reboot folgende Befehle verwendet haben:
zpool status -x
zpool export izbackup4-pool1
zpool import izbackup4-pool1
zpool status
zpool status -x
zpool clear izbackup4-pool1
zpool status -x
zpool status -v

Nun wäre es sinnvoll, den Dienst zfs-import-cache so anzupassen, dass dieser Dienst nicht gestartet wird, bevor alle Festplatten online sind, damit Neustarts ohne manuellen Eingriff erfolgen können.
Ich dachte dabei an ein shellskript und ConditionPathExixts= .
Ich habe dazu dies gefunden: https://www.baeldung.com/linux/systemd-conditional-service-start
Eine andere Idee wäre das Systemd Script so lange zu verzögern, bis alle Festplatten "online" sind.
https://www.baeldung.com/linux/systemd-postpone-script-boot
Was haltet ihr für den besseren Ansatz und wie kann ich das am einfachsten umsetzen?
Vielen Dank im Voraus schonmal
Uli Kleemann
Sysadmin
Hochschule der Medien
Stuttgart/Deutschland

English Version below

Hello everyone,

I need your help. I have a Proxmox HA cluster (backup) here,
where the zfs-import-cache is started by systemd before all disks are “online”, which requires a restart of the machine. So far we have solved this by using the following commands after the reboot:
zpool status -x
zpool export izbackup4-pool1
zpool import izbackup4-pool1
zpool status
zpool status -x
zpool clear izbackup4-pool1
zpool status -x
zpool status -v

Now it would make sense to adapt the service zfs-import-cache so that this service is not started before all hard disks are online, so that restarts can take place without manual intervention.
I was thinking of a shell script and ConditionPathExixts= .
I have found this: https://www.baeldung.com/linux/systemd-conditional-service-start
Another idea would be to delay the systemd script until all hard disks are “online”.
https://www.baeldung.com/linux/systemd-postpone-script-boot
What do you think is the better approach and what is the easiest way to implement this?
Any Help is appreciated
Many thanks in advance
Uli Kleemann
Sysadmin
Media University
Stuttgart/Germany
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!