Any way to disable/enable Samba when restarting my router?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
Kusaywa
DD-WRT Novice


Joined: 15 Oct 2020
Posts: 6

PostPosted: Mon Nov 09, 2020 15:41    Post subject: Any way to disable/enable Samba when restarting my router? Reply with quote
I was wondering if there was any way that Samba can be disabled/enabled from a command within dd-wrt when my router starts up or reboots? I don't want to use an external program or have to go into the program and manually disable the enable Samba to get it to run. Curious as to why this service just doesn't start on its own but I would like to have dd-wrt do it automatically. Thanks for any help
Sponsor
foz111
DD-WRT Guru


Joined: 01 Oct 2017
Posts: 707
Location: Earth

PostPosted: Mon Nov 09, 2020 17:32    Post subject: Reply with quote
a thread you may wish to read https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1003715&sid=0050b6ed101440e8453a5c4760c401a2
Kusaywa
DD-WRT Novice


Joined: 15 Oct 2020
Posts: 6

PostPosted: Mon Nov 09, 2020 18:34    Post subject: Reply with quote
I am going to give this a try but not sure if I have Samba or Samba 3 or doesn't it matter? My router is a WRT3200acm.

If you just add to a startup script generated through the GUI...or however you prefer...
Code:
sleep 30
stopservice samba3
startservice samba3
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12885
Location: Netherlands

PostPosted: Mon Nov 09, 2020 18:54    Post subject: Reply with quote
The real question is why do you need it.

You might have a crappy build which has this problem but unfortunately we do not know Sad

To get the best possible help read and follow the forum guidelines:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Kusaywa
DD-WRT Novice


Joined: 15 Oct 2020
Posts: 6

PostPosted: Tue Dec 08, 2020 22:13    Post subject: Reply with quote
Sorry for not getting back sooner. My current build is DD-WRT v3.0-r41874 std (01/03/20). My router is a WRT3200ACS. Problem is, when I'm away, if the power goes out or some odd thing, my family is left without access to the data on my USB. So I would like Samba to automatically start.
Tried a few different versions of DD-WRT and all don't start Samba automatically.
Thanks for any help.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12885
Location: Netherlands

PostPosted: Wed Dec 09, 2020 6:31    Post subject: Reply with quote
There was a bug which prevented Samba to run at startup around that time.

Newer builds do start automatically, but not the latest 44944 it appears samba is broken on that build

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Kusaywa
DD-WRT Novice


Joined: 15 Oct 2020
Posts: 6

PostPosted: Thu Dec 10, 2020 17:31    Post subject: Reply with quote
Thanks egc, I'll give it a try. Figures, I tried that build and when it didn't auto-start Samba, reverted back to what I'm on now.
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1857
Location: Hung Hom, Hong Kong

PostPosted: Thu Dec 10, 2020 19:32    Post subject: Re: Any way to disable/enable Samba when restarting my route Reply with quote
Kusaywa wrote:
I was wondering if there was any way that Samba can be disabled/enabled from a command within dd-wrt when my router starts up or reboots? I don't want to use an external program or have to go into the program and manually disable the enable Samba to get it to run.

I don't think you could disable samba3 after boot, but you could stop it! startservice and stopservice do not work for kernel modules as Samba in DD-WRT is now ksmbd not standalone daemons smbd/nmbd!
Code:
service samba3 stop
service samba3 start
Run `service` to see options!


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Thu Dec 10, 2020 21:00    Post subject: Reply with quote
I looked back to see what build I had used that was closest to yours, and it was 41954. For that one I had
Code:
stopservice samba3
startservice samba3

in the Startup section in GUI>Administration>Commands.

FWIW, I also discovered that in that build Samba rewrites /tmp/resolv.dnsmasq and in the process loses the DNS server pushed by the OpenVPN client. My "solution" was a kludge and might or might not actually work for others, but if it's a problem for you and you want to experiment, PM me.

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
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
You can attach files in this forum
You can download files in this forum