View previous topic :: View next topic |
Author |
Message |
mounty1 l33t
Joined: 06 Jul 2006 Posts: 942 Location: Queensland
|
Posted: Wed Jul 14, 2021 5:20 am Post subject: automatic startup of iSCSI swap (systemd) |
|
|
Hello, the usual way of automatically starting swap is to add an entry to /etc/fstab. However, in the case of swap on iSCSI there is a dependency problem inasmuch as /etc/fstab is obeyed earlier in the startup process than iscsid, so the iSCSI block device is not available when /etc/fstab is obeyed.
In this situation, what is the best-practice way of adding the swap? Is it to write a systemd unit that depends on the iscsid service?
Please note I am asking about best practice as opposed to random opinions. Thank you. _________________ Michael Mounteney |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3918
|
Posted: Thu Jul 15, 2021 5:06 pm Post subject: |
|
|
Plz use
Code: |
UUID=<uuid-of-iscsi-swap> none swap defaults,_netdev,x-systemd.requires=iscsid.service 0 1
####OR for safety
UUID=<uuid-of-iscsi-swap> none swap defaults,_netdev,x-systemd.requires=iscsid.service,nofail 0 1
|
Since your question is very miscellaneous in nature and not a standard practice in itself, I suppose there are NO best practices etc....
_________________
Last edited by alamahant on Thu Jul 15, 2021 6:00 pm; edited 1 time in total |
|
Back to top |
|
|
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2179
|
Posted: Thu Jul 15, 2021 5:28 pm Post subject: |
|
|
Best practice is what OpenRc does - which is /etc/init.d/swap, which calls "swapon -a", and you can read about it in the swapon man page.
I guess second best practice is what systemd does, i.e. something overcomplicated that seems to need generating, or at least that's what the Arch wiki says.
(At least reading that explains why my Arch systems use swap partitions I never told it about through /etc/fstab. I prefer software that does what it's told, not what it thinks I want...)
Your mileage will vary. _________________ Greybeard |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|