diff options
Diffstat (limited to 'net-fs/samba/files')
-rw-r--r-- | net-fs/samba/files/4.4/samba4.confd | 38 | ||||
-rw-r--r-- | net-fs/samba/files/4.4/samba4.initd-r1 | 55 | ||||
-rw-r--r-- | net-fs/samba/files/nmbd.service | 12 | ||||
-rw-r--r-- | net-fs/samba/files/samba-4.4.0-pam.patch | 29 | ||||
-rw-r--r-- | net-fs/samba/files/samba-4.5.1-compile_et_fix.patch | 16 | ||||
-rw-r--r-- | net-fs/samba/files/samba-glibc-2.26-no_rpc.patch | 14 | ||||
-rw-r--r-- | net-fs/samba/files/samba.conf | 2 | ||||
-rw-r--r-- | net-fs/samba/files/samba.service | 10 | ||||
-rw-r--r-- | net-fs/samba/files/smbd.service | 12 | ||||
-rw-r--r-- | net-fs/samba/files/smbd.socket | 9 | ||||
-rw-r--r-- | net-fs/samba/files/smbd_at.service | 7 | ||||
-rw-r--r-- | net-fs/samba/files/winbindd.service | 12 |
12 files changed, 216 insertions, 0 deletions
diff --git a/net-fs/samba/files/4.4/samba4.confd b/net-fs/samba/files/4.4/samba4.confd new file mode 100644 index 00000000..58b2c782 --- /dev/null +++ b/net-fs/samba/files/4.4/samba4.confd @@ -0,0 +1,38 @@ +# Add "winbind" to the daemon_list if you also want winbind to start. +# Replace "smbd nmbd" by "samba4" if you want the active directory domain controller part or the ntvfs +# file server part or the rpc proxy to start. +# Note that samba4 controls 'smbd' by itself, thus it can't be started manually. You can, however, +# tweak the behaviour of a samba4-controlled smbd by modifying your '/etc/samba/smb.conf' file +# accordingly. +daemon_list="smbd nmbd" + +#---------------------------------------------------------------------------- +# Daemons calls: <daemon_name>_<command_option> +#---------------------------------------------------------------------------- +my_service_name="samba" +my_service_PRE="unset TMP TMPDIR" +my_service_POST="" + +#---------------------------------------------------------------------------- +# Daemons calls: <daemon_name>_<command_option> +#---------------------------------------------------------------------------- +smbd_start_options="-D" +smbd_start="start-stop-daemon --start --exec /usr/sbin/smbd -- ${smbd_start_options}" +smbd_stop="start-stop-daemon --stop --exec /usr/sbin/smbd" +smbd_reload="killall -HUP smbd" + +nmbd_start_options="-D" +nmbd_start="start-stop-daemon --start --exec /usr/sbin/nmbd -- ${nmbd_start_options}" +nmbd_stop="start-stop-daemon --stop --exec /usr/sbin/nmbd" +nmbd_reload="killall -HUP nmbd" + +samba4_start_options="" +samba4_start="start-stop-daemon --start --exec /usr/sbin/samba -- ${samba4_start_options}" +samba4_stop="start-stop-daemon --stop --exec /usr/sbin/samba" +samba4_reload="killall -HUP samba" + +winbind_start_options="" +winbind_start="start-stop-daemon --start --exec /usr/sbin/winbindd -- ${winbind_start_options}" +winbind_stop="start-stop-daemon --stop --exec /usr/sbin/winbindd" +winbind_reload="killall -HUP winbindd" + diff --git a/net-fs/samba/files/4.4/samba4.initd-r1 b/net-fs/samba/files/4.4/samba4.initd-r1 new file mode 100644 index 00000000..52a9b68b --- /dev/null +++ b/net-fs/samba/files/4.4/samba4.initd-r1 @@ -0,0 +1,55 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +extra_started_commands="reload" +piddir="/run/samba" + +depend() { + after slapd + need net + use cupsd +} + +DAEMONNAME="${SVCNAME##samba.}" +[ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME} + +signal_do() { + local signal="$1" + [ -z "${signal}" ] && return 0 + + local result=0 last_result=0 daemon= cmd_exec= + for daemon in ${daemon_list} ; do + eval cmd_exec=\$${daemon}_${signal} + if [ -n "${cmd_exec}" ]; then + ebegin "${my_service_name} -> ${signal}: ${daemon}" + #echo ${cmd} '->' ${!cmd} + ${cmd_exec} > /dev/null + last_result=$? + eend ${last_result} + fi + result=$(( ${result} + ${last_result} )) + done + return ${result} +} + +start() { + ${my_service_PRE} + [ -d "${piddir}" ] || mkdir -p "${piddir}" + signal_do start && return 0 + + eerror "Error: starting services (see system logs)" + signal_do stop + return 1 +} +stop() { + ${my_service_PRE} + if signal_do stop ; then + ${my_service_POST} + return 0 + fi +} +reload() { + ${my_service_PRE} + signal_do reload +} diff --git a/net-fs/samba/files/nmbd.service b/net-fs/samba/files/nmbd.service new file mode 100644 index 00000000..44b4ffba --- /dev/null +++ b/net-fs/samba/files/nmbd.service @@ -0,0 +1,12 @@ +[Unit] +Description=Samba NetBIOS name server +After=network.target + +[Service] +Type=forking +PIDFile=/var/run/samba/nmbd.pid +ExecStart=/usr/sbin/nmbd -D +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/net-fs/samba/files/samba-4.4.0-pam.patch b/net-fs/samba/files/samba-4.4.0-pam.patch new file mode 100644 index 00000000..45160138 --- /dev/null +++ b/net-fs/samba/files/samba-4.4.0-pam.patch @@ -0,0 +1,29 @@ +--- samba-4.4.0rc2/source3/wscript ++++ samba-4.4.0rc2/source3/wscript +@@ -870,7 +870,7 @@ + if conf.env.with_iconv: + conf.DEFINE('HAVE_ICONV', 1) + +- if Options.options.with_pam: ++ if Options.options.with_pam != False: + use_pam=True + conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h') + if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'): +@@ -943,6 +943,17 @@ + conf.DEFINE('WITH_PAM', 1) + conf.DEFINE('WITH_PAM_MODULES', 1) + ++ else: ++ Logs.warn("PAM disabled") ++ use_pam=False ++ conf.undefine('WITH_PAM') ++ conf.undefine('WITH_PAM_MODULES') ++ conf.undefine('HAVE_SECURITY_PAM_APPL_H') ++ conf.undefine('PAM_RHOST') ++ conf.undefine('PAM_TTY') ++ conf.undefine('HAVE_PAM_PAM_APPL_H') ++ ++ + seteuid = False + + # diff --git a/net-fs/samba/files/samba-4.5.1-compile_et_fix.patch b/net-fs/samba/files/samba-4.5.1-compile_et_fix.patch new file mode 100644 index 00000000..463512f9 --- /dev/null +++ b/net-fs/samba/files/samba-4.5.1-compile_et_fix.patch @@ -0,0 +1,16 @@ +--- samba-4.5.1/source4/heimdal_build/wscript_configure ++++ samba-4.5.1/source4/heimdal_build/wscript_configure +@@ -258,7 +258,11 @@ + + # With the proper checks in place we should be able to build against the system libtommath. + #if conf.CHECK_BUNDLED_SYSTEM('tommath', checkfunctions='mp_init', headers='tommath.h'): + # conf.define('USING_SYSTEM_TOMMATH', 1) + +-check_system_heimdal_binary("compile_et") +-check_system_heimdal_binary("asn1_compile") ++# comment out next line to stop Gentoo Samba build from using the compile_et in e2fsprogs-libs ++# to compile the error tables. This produces a compile error later on. ++#check_system_heimdal_binary("compile_et") ++# ++# As a precaution do the same for asn1_compile ++#check_system_heimdal_binary("asn1_compile") diff --git a/net-fs/samba/files/samba-glibc-2.26-no_rpc.patch b/net-fs/samba/files/samba-glibc-2.26-no_rpc.patch new file mode 100644 index 00000000..e6644684 --- /dev/null +++ b/net-fs/samba/files/samba-glibc-2.26-no_rpc.patch @@ -0,0 +1,14 @@ +https://attachments.samba.org/attachment.cgi?id=13172 +https://bugs.gentoo.org/637320 + +--- a/lib/replace/wscript ++++ b/lib/replace/wscript +@@ -71,7 +71,7 @@ + conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h') + conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h') + +- conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H') ++ conf.CHECK_CODE('ypstat s;', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H') + + conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h') + conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h') diff --git a/net-fs/samba/files/samba.conf b/net-fs/samba/files/samba.conf new file mode 100644 index 00000000..e0a6f325 --- /dev/null +++ b/net-fs/samba/files/samba.conf @@ -0,0 +1,2 @@ +D /run/samba 0755 root root +D /run/lock/samba 0755 root root diff --git a/net-fs/samba/files/samba.service b/net-fs/samba/files/samba.service new file mode 100644 index 00000000..8214ff86 --- /dev/null +++ b/net-fs/samba/files/samba.service @@ -0,0 +1,10 @@ +[Unit] +Description=Samba AD server +After=network.target winbindd.service +Conflicts=nmbd.service smbd.service + +[Service] +ExecStart=/usr/sbin/samba --interactive + +[Install] +WantedBy=multi-user.target diff --git a/net-fs/samba/files/smbd.service b/net-fs/samba/files/smbd.service new file mode 100644 index 00000000..5c006a44 --- /dev/null +++ b/net-fs/samba/files/smbd.service @@ -0,0 +1,12 @@ +[Unit] +Description=Samba SMB/CIFS server +After=network.target nmbd.service winbindd.service + +[Service] +Type=forking +PIDFile=/var/run/samba/smbd.pid +ExecStart=/usr/sbin/smbd -D +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/net-fs/samba/files/smbd.socket b/net-fs/samba/files/smbd.socket new file mode 100644 index 00000000..833bf438 --- /dev/null +++ b/net-fs/samba/files/smbd.socket @@ -0,0 +1,9 @@ +[Unit] +Description=Samba SMB/CIFS server socket + +[Socket] +ListenStream=445 +Accept=yes + +[Install] +WantedBy=sockets.target diff --git a/net-fs/samba/files/smbd_at.service b/net-fs/samba/files/smbd_at.service new file mode 100644 index 00000000..e1f71be3 --- /dev/null +++ b/net-fs/samba/files/smbd_at.service @@ -0,0 +1,7 @@ +[Unit] +Description=Samba SMB/CIFS server instance + +[Service] +ExecStart=/usr/sbin/smbd -F +ExecReload=/bin/kill -HUP $MAINPID +StandardInput=socket diff --git a/net-fs/samba/files/winbindd.service b/net-fs/samba/files/winbindd.service new file mode 100644 index 00000000..67a778fc --- /dev/null +++ b/net-fs/samba/files/winbindd.service @@ -0,0 +1,12 @@ +[Unit] +Description=Samba Winbind daemon +After=network.target nmbd.service + +[Service] +Type=forking +PIDFile=/var/run/samba/winbindd.pid +ExecStart=/usr/sbin/winbindd -D +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target |