public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] systemd - how to pre start nfs client services
@ 2024-08-31 14:32 Daniel Frey
  2024-08-31 17:28 ` Michael
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Frey @ 2024-08-31 14:32 UTC (permalink / raw
  To: gentoo-user

I have a few frontends on TVs and use automount on some NFS sources.

However, I can't seem find a way to start the nfs client services on 
startup. Wiki for NFS and other documentation says that systemd does 
this automatically (and it does) but I'm trying to eliminate a delay.

The frontend start up and when you go to the screen that scans the 
folder, it takes 5-10 seconds for systemd to start these services and 
mount the NFS locations.

On openrc this is simple and it takes less than a second at that screen.

It is not waiting for a network, as on startup the interface connects to 
a database and this part is working fine (it would be blank if it 
started with no network.)

Dan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] systemd - how to pre start nfs client services
  2024-08-31 14:32 [gentoo-user] systemd - how to pre start nfs client services Daniel Frey
@ 2024-08-31 17:28 ` Michael
  2024-09-01 18:43   ` Daniel Frey
  2024-09-01 18:57   ` Daniel Frey
  0 siblings, 2 replies; 4+ messages in thread
From: Michael @ 2024-08-31 17:28 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

On Saturday, 31 August 2024 15:32:38 BST Daniel Frey wrote:
> I have a few frontends on TVs and use automount on some NFS sources.
> 
> However, I can't seem find a way to start the nfs client services on
> startup. Wiki for NFS and other documentation says that systemd does
> this automatically (and it does) but I'm trying to eliminate a delay.
> 
> The frontend start up and when you go to the screen that scans the
> folder, it takes 5-10 seconds for systemd to start these services and
> mount the NFS locations.
> 
> On openrc this is simple and it takes less than a second at that screen.
> 
> It is not waiting for a network, as on startup the interface connects to
> a database and this part is working fine (it would be blank if it
> started with no network.)
> 
> Dan

Does 'systemd-analyze blame' show which service component causes the delay(s)?  
If the same service dependency occurs on both systems then it ought to take 
the same time to automount an exported directory.  This points to some systemd 
specific  service dependency/hierarchy causing the delay - as long as all 
other configuration variables remain the same.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] systemd - how to pre start nfs client services
  2024-08-31 17:28 ` Michael
@ 2024-09-01 18:43   ` Daniel Frey
  2024-09-01 18:57   ` Daniel Frey
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Frey @ 2024-09-01 18:43 UTC (permalink / raw
  To: gentoo-user

On 8/31/24 10:28, Michael wrote:
> On Saturday, 31 August 2024 15:32:38 BST Daniel Frey wrote:
>> I have a few frontends on TVs and use automount on some NFS sources.
>>
>> However, I can't seem find a way to start the nfs client services on
>> startup. Wiki for NFS and other documentation says that systemd does
>> this automatically (and it does) but I'm trying to eliminate a delay.
>>
>> The frontend start up and when you go to the screen that scans the
>> folder, it takes 5-10 seconds for systemd to start these services and
>> mount the NFS locations.
>>
>> On openrc this is simple and it takes less than a second at that screen.
>>
>> It is not waiting for a network, as on startup the interface connects to
>> a database and this part is working fine (it would be blank if it
>> started with no network.)
>>
>> Dan
> 
> Does 'systemd-analyze blame' show which service component causes the delay(s)?
> If the same service dependency occurs on both systems then it ought to take
> the same time to automount an exported directory.  This points to some systemd
> specific  service dependency/hierarchy causing the delay - as long as all
> other configuration variables remain the same.

That's a handy command, thanks.

According to the output:

10.097s storage-nas.mount
  4.550s systemd-networkd-wait-online.service

It's waiting for the automount. The wait-online completes, the UI 
immediately starts, and then I went to browse the catalog, and it takes 
about 6 seconds to start the services and then mount it.

I just want to have the needed NFS services started during startup, 
instead of waiting for someone to browse the library/files.

This is easy to do in openrc with the nfs-client service, but no such 
service unit exists with systemd as far as I can tell.

Dan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] systemd - how to pre start nfs client services
  2024-08-31 17:28 ` Michael
  2024-09-01 18:43   ` Daniel Frey
@ 2024-09-01 18:57   ` Daniel Frey
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Frey @ 2024-09-01 18:57 UTC (permalink / raw
  To: gentoo-user

On 8/31/24 10:28, Michael wrote:
> On Saturday, 31 August 2024 15:32:38 BST Daniel Frey wrote:
>> I have a few frontends on TVs and use automount on some NFS sources.
>>
>> However, I can't seem find a way to start the nfs client services on
>> startup. Wiki for NFS and other documentation says that systemd does
>> this automatically (and it does) but I'm trying to eliminate a delay.
>>
>> The frontend start up and when you go to the screen that scans the
>> folder, it takes 5-10 seconds for systemd to start these services and
>> mount the NFS locations.
>>
>> On openrc this is simple and it takes less than a second at that screen.
>>
>> It is not waiting for a network, as on startup the interface connects to
>> a database and this part is working fine (it would be blank if it
>> started with no network.)
>>
>> Dan
> 
> Does 'systemd-analyze blame' show which service component causes the delay(s)?
> If the same service dependency occurs on both systems then it ought to take
> the same time to automount an exported directory.  This points to some systemd
> specific  service dependency/hierarchy causing the delay - as long as all
> other configuration variables remain the same.

I just had a thought, and I don't know why I didn't think of it before. 
I just looked at /etc/init.d/nfsclient and enabled the related services 
in systemd.

Rebooted, now it works as expected.

Dan


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-01 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-31 14:32 [gentoo-user] systemd - how to pre start nfs client services Daniel Frey
2024-08-31 17:28 ` Michael
2024-09-01 18:43   ` Daniel Frey
2024-09-01 18:57   ` Daniel Frey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox