Delay Samba Startup?


shwa87

Recommended Posts

Hello - is there a way to delay the startup of samba until the array is fully started and/or start it manually or via a script after the array is fully started via user scripts?

 

Could I theoretically use a user script to disable smb on array shutdown and then a user script to enable it at startup or sometime after startup?

 

Thanks!

Link to comment

I want to stop getting bootup delays due to winbindd hanging because it keeps trying to connect because my domain controller runs in an unRAID VM.  So I'd like to effectively keep Samba out of the picture until the array is started so any delays aren't as a big deal.  Alternatively, even being able to have winbindd stop trying after X number of failures (i.e. say 2 failures) during bootup.

 

Thanks!

Link to comment

I think I have a possible solution... add this to a user script that runs when the array is shutdown:

 

sed -i 's/shareSMBEnabled="ads"/shareSMBEnabled=“no”/g’ /boot/config/share.cfg

 

But I don't think I can do it in reverse because the config file would only be read at startup.  So essentially, I'd need a set of commands that would enable SMB AD as the array is started. This seems like it could be possible, since I can join AD via CLI without stopping the array even though if its done in the GUI it forces services to stop and start (and thus fails since the domain controller runs in a VM)

 

Are there commands that can achieve this?

Link to comment
5 hours ago, shwa87 said:

So I'd like to effectively keep Samba out of the picture until the array is started

Have you fully thought about what might happen?

 

5 hours ago, shwa87 said:

keep Samba out of the picture until the array is started

Are Samba shares on your array?

 

They will or won't be before/after it starts.

 

Clear as mud. :)

 

MrGrey.

Link to comment
7 hours ago, shwa87 said:

it keeps trying to connect because my domain controller runs in an unRAID VM.  So I'd like to effectively keep Samba out of the picture until the array is started so any delays aren't as a big deal

A typical "UNRAID not understood" and "Chicken & Egg" Problem.

 

A VM on UNRAID will not start without the array beeing started and samba is up and running (the shares are available).

 

So there is NO WAY to delay SAMBA until your Domain Controller is up.

 

You either live with the (I bet) excessive delays or you correct your error and move off your PDC to a real computer (or VM elsewhere).

 

  • Upvote 1
Link to comment
10 hours ago, MAM59 said:

A VM on UNRAID will not start without the array beeing started and samba is up and running (the shares are available).

 

Why does samba need to be up and running in order for vms to start?  There are no shares being passed to the VMs nor are shares mapped.  The VMs live on an SSD pool and the domains and system 'shares' are not SMB shares...

Link to comment
6 hours ago, Kilrah said:

That's already the case, samba only starts once the array is started. But Dockers/VM also start after the array is started, so...

If this is the case, why does Samba/winbind lag/hang even when the array is NOT slated to start on boot if there's an unclean shutdown or if I set it not to start on boot for whatever reason?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.