2 # ctdb event script for Netbios Name Services
4 [ -n "$CTDB_BASE" ] || \
5 CTDB_BASE
=$
(d
=$
(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
7 .
"${CTDB_BASE}/functions"
11 case $CTDB_INIT_STYLE in
13 CTDB_SERVICE_NMB
=${CTDB_SERVICE_NMB:-nmb}
16 CTDB_SERVICE_NMB
=${CTDB_SERVICE_NMB:-nmbd}
19 # Use redhat style as default:
20 CTDB_SERVICE_NMB
=${CTDB_SERVICE_NMB:-""}
24 service_name
="netbios"
28 ctdb_setup_state_dir
"service" "$service_name"
32 # make sure nmbd is not already started
33 service
"$CTDB_SERVICE_NMB" stop
> /dev
/null
2>&1
34 killall
-0 -q nmbd
&& {
36 # make absolutely sure nmbd is dead
40 # start Samba nmbd service. Start it reniced, as under very heavy load
41 # the number of smbd processes will mean that it leaves few cycles
43 nice_service
"$CTDB_SERVICE_NMB" start || die
"Failed to start nmbd"
48 service
"$CTDB_SERVICE_NMB" stop
51 ###########################