How to start smbd nmbd and winbindd with openrc

Post your general questions or comments about GhostBSD here!
Post Reply
gautamdas
Posts: 6
Joined: Sat Jul 06, 2019 4:53 pm
Has thanked: 2 times
Been thanked: 0

How to start smbd nmbd and winbindd with openrc

Post by gautamdas » Tue Jul 09, 2019 9:37 pm

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: 1360
Joined: Mon Nov 19, 2012 7:54 pm
Has thanked: 34 times
Been thanked: 41 times

Re: How to start smbd nmbd and winbindd with openrc

Post by ericbsd » Wed Jul 10, 2019 10:57 am

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: 6
Joined: Sat Jul 06, 2019 4:53 pm
Has thanked: 2 times
Been thanked: 0

Re: How to start smbd nmbd and winbindd with openrc

Post by gautamdas » Wed Jul 10, 2019 4:21 pm

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.....

Post Reply