How to start smbd nmbd and winbindd with openrc

Post your general questions or comments about GhostBSD here!
Post Reply
gautamdas
Posts: 9
Joined: Sat Jul 06, 2019 4:53 pm

How to start smbd nmbd and winbindd with openrc

Post by gautamdas »

Need some help getting samba services (smbd, nmbd, and winbindd) to start up on boot.
I am currently getting them started by a cron script.

The sanba_server script in /usr/local/etc/init.d is working as I expect it to - but is not being used by openrc
root@ghost:~ # /usr/local/etc/rc.d/samba_server status
nmbd is running as pid 1763.
smbd is running as pid 1771.
winbindd is running as pid 1776.

openrc is using /usr/local/etc/init.d/samba_server script - which is broken.

Is the openrc integration for samba_server not fully baked?

root@ghost:~ # /usr/local/etc/init.d/samba_server status
* start-stop-daemon: /usr/local/sbin/nmbd is already running
* start-stop-daemon: /usr/local/sbin/smbd is already running
* start-stop-daemon: /usr/local/sbin/winbindd is already running

root@ghost:~ # /usr/local/etc/init.d/samba_server stop
* WARNING: samba_server is already stopped
root@ghost:~ # /usr/local/etc/init.d/samba_server start
Performing sanity check on Samba configuration: OK
* start-stop-daemon: /usr/local/sbin/nmbd is already running
* start-stop-daemon: /usr/local/sbin/smbd is already running
* start-stop-daemon: /usr/local/sbin/winbindd is already running
* ERROR: samba_server failed to start

root@ghost:~ # /usr/local/etc/init.d/samba_server zap
* Manually resetting samba_server to stopped state

root@ghost:~ # /usr/local/etc/rc.d/samba_server status
nmbd is running as pid 1763.
smbd is running as pid 1771.
winbindd is running as pid 1776.
root@ghost:~ #

What am I missing?
Thanks.
User avatar
ericbsd
Developer
Posts: 2052
Joined: Mon Nov 19, 2012 7:54 pm

Re: How to start smbd nmbd and winbindd with openrc

Post by ericbsd »

used service command to start and stop services:

Code: Select all

service samba_server start

Code: Select all

service samba_server stop
To get the list of service available:

Code: Select all

rc-service -l
To get the list of service running:

Code: Select all

rc-status
To get the list of service starting at boot.

Code: Select all

rc-update
To add a service at boot:

Code: Select all

rc-update add <service> <group>
example:

Code: Select all

rc-update add samba_server default
Note that group is not needed if you sned it to default group

Code: Select all

rc-update add samba_server
gautamdas
Posts: 9
Joined: Sat Jul 06, 2019 4:53 pm

Re: How to start smbd nmbd and winbindd with openrc

Post by gautamdas »

made sure samba processes are not running

root@ghost:~ # ps aux | grep smbd
root 1962 0.0 0.0 11640 3108 2 S+ 15:16 0:00.00 grep smbd
root@ghost:~ #
root@ghost:~ # service samba_server start
Performing sanity check on Samba configuration: OK
root@ghost:~ # ps aux | grep smbd
root 2000 4.5 1.2 174056 156036 - S 15:16 0:00.00 /usr/local/sbin/smbd
root 1989 4.4 1.2 173516 155916 - Ss 15:16 0:00.40 /usr/local/sbin/smbd
root 1997 3.3 0.9 128936 113248 - S 15:16 0:00.00 /usr/local/sbin/smbd
root 1996 3.2 0.9 128944 113260 - S 15:16 0:00.00 /usr/local/sbin/smbd
root 2002 0.0 0.0 11640 3108 2 S+ 15:16 0:00.00 grep smbd

So far so good

The rest are not working
root@ghost:~ # service samba_server stop
/libexec/rc/sh/openrc-run.sh: reverse_list: not found

root@ghost:~ # service samba_server status
* start-stop-daemon: /usr/local/sbin/nmbd is already running
* start-stop-daemon: /usr/local/sbin/smbd is already running
* start-stop-daemon: /usr/local/sbin/winbindd is already running
root@ghost:~ #

Hmmmm.....
martintoy
Posts: 1
Joined: Wed Sep 11, 2019 6:07 pm

Re: How to start smbd nmbd and winbindd with openrc

Post by martintoy »

Same here,
I just tried to enable samba or share a folder
but it shows an error, my goal was to share a folder from my ghostbsd to my Windows LAN

"'net usershare' returned error 255: net usershare add: cannot convert name "Everyone" to a SID. The transport-connection attempt was refused by the remote system.. Maybe smbd is not running."

Theres no logs about how the service is running.

Also, to restart the service it shows,
"service samba_server restart
/libexec/rc/sh/openrc-run.sh: reverse_list: not found
Performing sanity check on Samba configuration: OK"

but nothing happens.

Please help

Martin
Post Reply