Posted: Mon Nov 09, 2020 15:41 Post subject: Any way to disable/enable Samba when restarting my router?
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
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.
Joined: 26 Mar 2013 Posts: 1857 Location: Hung Hom, Hong Kong
Posted: Thu Dec 10, 2020 19:32 Post subject: Re: Any way to disable/enable Samba when restarting my route
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!
Joined: 04 Aug 2018 Posts: 1447 Location: Appalachian mountains, USA
Posted: Thu Dec 10, 2020 21:00 Post subject:
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.