View | Details | Raw Unified | Return to bug 197255
Collapse All | Expand All

(-)net/samba41/files/samba_server.in (-16 / +18 lines)
Lines 28-41 Link Here
28
name="samba_server"
28
name="samba_server"
29
rcvar=${name}_enable
29
rcvar=${name}_enable
30
30
31
# Defaults
32
samba_server_config_default="%%SAMBA4_CONFDIR%%/%%SAMBA4_CONFIG%%"
33
samba_server_config=${samba_server_config=${samba_server_config_default}}
34
samba_server_configfile_arg=${samba_server_config:+--configfile="${samba_server_config}"}			#"
35
#testparm_command="%%PREFIX%%/bin/samba-tool testparm --suppress-prompt --verbose ${samba_server_configfile_arg}"
36
testparm_command="%%PREFIX%%/bin/testparm --suppress-prompt --verbose ${samba_server_config}"
37
smbcontrol_command="%%PREFIX%%/bin/smbcontrol"
38
39
# Custom commands
31
# Custom commands
40
extra_commands="reload status"
32
extra_commands="reload status"
41
33
Lines 144-149 Link Here
144
136
145
samba_server_config_init() {
137
samba_server_config_init() {
146
    local name
138
    local name
139
    # Load configuration
140
    load_rc_config "${name}"
141
    # Defaults
142
    samba_server_enable=${samba_server_enable:=NO}
143
    samba_server_config_default="%%SAMBA4_CONFDIR%%/%%SAMBA4_CONFIG%%"
144
    samba_server_config=${samba_server_config=${samba_server_config_default}}
145
    samba_server_configfile_arg=${samba_server_config:+--configfile="${samba_server_config}"}			#"
146
    #testparm_command="%%PREFIX%%/bin/samba-tool testparm --suppress-prompt --verbose ${samba_server_configfile_arg}"
147
    testparm_command="%%PREFIX%%/bin/testparm --suppress-prompt --verbose ${samba_server_config}"
148
    smbcontrol_command="%%PREFIX%%/bin/smbcontrol"
147
    # Determine what daemons are necessary to run Samba in the current role
149
    # Determine what daemons are necessary to run Samba in the current role
148
    samba_server_role=$(${testparm_command} --parameter-name='server role' 2>/dev/null)
150
    samba_server_role=$(${testparm_command} --parameter-name='server role' 2>/dev/null)
149
    case "${samba_server_role}" in
151
    case "${samba_server_role}" in
Lines 154-166 Link Here
154
	    samba_daemons="nmbd smbd winbindd"
156
	    samba_daemons="nmbd smbd winbindd"
155
	    ;;
157
	    ;;
156
    esac
158
    esac
157
    # Load configuration
159
    # Load daemons configuration
158
    load_rc_config "${name}"
159
    for name in ${samba_daemons}; do
160
    for name in ${samba_daemons}; do
160
	load_rc_config "${name}"
161
	load_rc_config "${name}"
161
    done
162
    done
162
    # Defaults
163
    samba_server_enable=${samba_server_enable:=NO}
164
    # Setup dependent variables
163
    # Setup dependent variables
165
    if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then
164
    if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then
166
	for name in ${samba_daemons}; do
165
	for name in ${samba_daemons}; do
Lines 170-182 Link Here
170
		if [ -n "${samba_server_idmap}" ]; then
169
		if [ -n "${samba_server_idmap}" ]; then
171
		    winbindd_enable="YES"
170
		    winbindd_enable="YES"
172
		fi
171
		fi
172
	    else
173
		# Set variable to 'YES' only if it is unset
174
		eval ${name}_enable=\${${name}_enable=YES}
173
	    fi
175
	    fi
174
	    # Set variable to 'YES' only if it is unset
175
	    eval ${name}_enable=\${${name}_enable-YES}
176
	    # If variable is empty set it to 'NO'
177
	    eval ${name}_enable=\${${name}_enable:-NO}
178
	done
176
	done
179
    fi
177
    fi
178
    for name in ${samba_daemons}; do
179
	# If variable is empty set it to 'NO'
180
	eval ${name}_enable=\${${name}_enable:-NO}
181
    done
180
}
182
}
181
183
182
# Load configuration variables
184
# Load configuration variables

Return to bug 197255