#!/sbin/openrc-run name=$RC_SVCNAME description="ksmbd userspace daemon" command="/usr/sbin/ksmbd.mountd" command_control="/usr/sbin/ksmbd.control" command_args="-s" command_user="root:root" extra_commands="reload" depend() { after net network-online use network-online } CONFD="/etc/ksmbd/smb.conf" checkconfig() { if [ ! -f "$CONFD" ]; then eerror "Configuration file not found!" eerror "You must configure ${CONFD} file first!" return 1 fi } start_pre() { checkconfig || return 1 /sbin/modprobe ksmbd || return 1 } stop() { ebegin "Stopping $RC_SVCNAME" ${command_control} -s eend $? } stop_post() { /sbin/modprobe -r -q ksmbd || return 0 } reload() { ebegin "Reloading $RC_SVCNAME" /bin/sh -c "${command_control} -s && ${command} -s" eend $? }