Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
automatic startup of iSCSI swap (systemd)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 942
Location: Queensland

PostPosted: Wed Jul 14, 2021 5:20 am    Post subject: automatic startup of iSCSI swap (systemd) Reply with quote

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
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3924

PostPosted: Thu Jul 15, 2021 5:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2185

PostPosted: Thu Jul 15, 2021 5:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
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