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

(-)a/debian/ctdb.install (-1 lines)
 Lines 4-10   ctdb/config/ctdb.tunables etc/ctdb Link Here 
4
ctdb/config/script.options etc/ctdb
4
ctdb/config/script.options etc/ctdb
5
etc/ctdb
5
etc/ctdb
6
etc/sudoers.d
6
etc/sudoers.d
7
[linux-any] lib/systemd/system/ctdb.service
8
usr/bin/ctdb
7
usr/bin/ctdb
9
usr/bin/ctdb_diagnostics
8
usr/bin/ctdb_diagnostics
10
usr/bin/ltdbtool
9
usr/bin/ltdbtool
(-)a/debian/rules (-2 / +2 lines)
 Lines 73-79   config-args = \ Link Here 
73
	--with-socketpath=/run/ctdb/ctdbd.socket \
73
	--with-socketpath=/run/ctdb/ctdbd.socket \
74
	--with-logdir=/var/log/ctdb \
74
	--with-logdir=/var/log/ctdb \
75
75
76
ifeq (${DEB_HOST_ARCH_OS}, linux) # extra linux-specific features
76
ifeq (${DEB_HOST_ARCH_OS}, ucs-future) # extra linux-specific features
77
with-glusterfs = yes
77
with-glusterfs = yes
78
with-ceph = yes
78
with-ceph = yes
79
with-snapper = yes
79
with-snapper = yes
 Lines 236-242   override_dh_auto_install-arch: Link Here 
236
	install -p -m755 debian/update-apparmor-samba-profile -t debian/tmp/usr/share/samba/
236
	install -p -m755 debian/update-apparmor-samba-profile -t debian/tmp/usr/share/samba/
237
	install -Dp -m0644 debian/samba.ufw.profile debian/tmp/etc/ufw/applications.d/samba
237
	install -Dp -m0644 debian/samba.ufw.profile debian/tmp/etc/ufw/applications.d/samba
238
	install -Dp -m0644 debian/source_samba.py -t debian/tmp/usr/share/apport/package-hooks/
238
	install -Dp -m0644 debian/source_samba.py -t debian/tmp/usr/share/apport/package-hooks/
239
ifeq ($(DEB_HOST_ARCH_OS), linux)
239
ifeq ($(DEB_HOST_ARCH_OS), ucs-future)
240
# Services fixups. Historically, debian used smbd, nmbd and samba-ad-dc service names.
240
# Services fixups. Historically, debian used smbd, nmbd and samba-ad-dc service names.
241
# Upstream samba used names smb, nmb and samba.
241
# Upstream samba used names smb, nmb and samba.
242
# We can not easily rename them now (need to rename possible overrides and drop-ins),
242
# We can not easily rename them now (need to rename possible overrides and drop-ins),
(-)a/debian/samba.install (-3 lines)
 Lines 1-8    Link Here 
1
#!/usr/bin/dh-exec --with-scripts=filter-arch,filter-build-profiles
1
#!/usr/bin/dh-exec --with-scripts=filter-arch,filter-build-profiles
2
etc/ufw/applications.d/samba
2
etc/ufw/applications.d/samba
3
[linux-any] lib/systemd/system/nmb*.service
4
[linux-any] lib/systemd/system/samba*.service
5
[linux-any] lib/systemd/system/smb*.service
6
usr/bin/dumpmscat
3
usr/bin/dumpmscat
7
usr/bin/mvxattr
4
usr/bin/mvxattr
8
usr/bin/oLschema2ldif
5
usr/bin/oLschema2ldif
(-)a/debian/winbind.install (-1 lines)
 Lines 1-5    Link Here 
1
#!/usr/bin/dh-exec --with-scripts=filter-arch,filter-build-profiles
1
#!/usr/bin/dh-exec --with-scripts=filter-arch,filter-build-profiles
2
[linux-any] lib/systemd/system/winbind.service
3
<pkg.samba.mitkrb5> usr/lib/*/samba/krb5/winbind_krb5_localauth.so
2
<pkg.samba.mitkrb5> usr/lib/*/samba/krb5/winbind_krb5_localauth.so
4
<pkg.samba.mitkrb5> usr/share/man/man8/winbind_krb5_localauth.8
3
<pkg.samba.mitkrb5> usr/share/man/man8/winbind_krb5_localauth.8
5
usr/bin/ntlm_auth
4
usr/bin/ntlm_auth
(-)a/debian/samba.postinst (-11 / +57 lines)
 Lines 6-17   nmbd_error_handler() { Link Here 
6
    if [ -d /sys/class/net/lo ] && ls /sys/class/net | grep -qv ^lo$; then
6
    if [ -d /sys/class/net/lo ] && ls /sys/class/net | grep -qv ^lo$; then
7
        # https://bugs.debian.org/893762
7
        # https://bugs.debian.org/893762
8
        echo 'WARNING: nmbd failed to start as there is no non-loopback interfaces available.'
8
        echo 'WARNING: nmbd failed to start as there is no non-loopback interfaces available.'
9
        echo 'Either add an interface or set "disable netbios = yes" in smb.conf'
9
        echo 'Either add an interface or set "disable netbios = yes" in smb.conf and run "systemctl mask nmbd"'
10
        return 0
10
        return 0
11
    elif command -v ip > /dev/null && ip a show | grep '^[[:space:]]*inet ' | grep -vq ' lo$'; then
11
    elif command -v ip > /dev/null && ip a show | grep '^[[:space:]]*inet ' | grep -vq ' lo$'; then
12
        # https://bugs.debian.org/859526
12
        # https://bugs.debian.org/859526
13
        echo 'WARNING: nmbd failed to start as there is no local IPv4 non-loopback interfaces available.'
13
        echo 'WARNING: nmbd failed to start as there is no local IPv4 non-loopback interfaces available.'
14
        echo 'Either add an IPv4 address or set "disable netbios = yes" in smb.conf'
14
        echo 'Either add an IPv4 address or set "disable netbios = yes" in smb.conf and run "systemctl mask nmbd"'
15
        return 0
15
        return 0
16
    else
16
    else
17
        echo 'ERROR: nmbd failed to start.'
17
        echo 'ERROR: nmbd failed to start.'
 Lines 19-24   nmbd_error_handler() { Link Here 
19
    fi
19
    fi
20
}
20
}
21
21
22
mask_services() {
23
    local reason="$1"
24
    shift
25
    local masked_count=0
26
    mkdir -p /etc/systemd/system
27
    echo "${reason}: Masking $*"
28
    echo "Please ignore the following error about deb-systemd-helper not finding those services."
29
    while true; do
30
        local service_name="$1"
31
        if [ -z "$service_name" ]; then
32
            break
33
        fi
34
        shift
35
        if [ ! -e "/etc/systemd/system/${service_name}" ]; then
36
            ln -s /dev/null "/etc/systemd/system/${service_name}"
37
            echo "(${service_name} masked)"
38
            masked_count=$((masked_count+1))
39
        elif [ -h "/etc/systemd/system/${service_name}" ] \
40
            && [ "$(realpath /etc/systemd/system/${service_name})" = /dev/null ] \
41
        ; then
42
            echo "(${service_name} already masked)"
43
        else
44
            echo "WARNING ${service_name} should be masked. The install may fail."
45
        fi
46
    done
47
    # In case this system is running systemd, we make systemd reload the unit files
48
    # to pick up changes.
49
    if [ "${masked_count}" -ge 1 -a -d /run/systemd/system ] ; then
50
        systemctl --system daemon-reload >/dev/null || true
51
    fi
52
}
53
22
# We generate several files during the postinst, and we don't want
54
# We generate several files during the postinst, and we don't want
23
#	them to be readable only by root.
55
#	them to be readable only by root.
24
umask 022
56
umask 022
 Lines 31-45   then Link Here 
31
    [ -d $dir ] || install -d -m 1770 -g sambashare $dir
63
    [ -d $dir ] || install -d -m 1770 -g sambashare $dir
32
fi
64
fi
33
65
34
# in 4.17.4+dfsg-3 we stopped masking services, unmask them here
66
mkdir -p /run/samba # shut up [samba-tool] testparm warning
35
if [ configure = "$1" ] && dpkg --compare-versions "$2" lt-nl 2:4.17.4+dfsg-3~
67
36
then
68
# mimic source4/smbd/server.c and mask service before it fails
37
    for s in nmbd smbd samba-ad-dc; do
69
# NB: server role = active directory domain controller is what we need to properly support
38
	if [ /dev/null = $(realpath /etc/systemd/system/$s.service) ]
70
# NB: server services = smb is not compiled in
39
	then
71
# NB: dcerpc endpoint servers = remote is for developpement
40
	    rm -f /etc/systemd/system/$s.service
72
# NB: dcerpc endpoint servers = mapiproxy is for OpenChange which is dead
41
	fi
73
SERVER_ROLE=`samba-tool testparm --parameter-name="server role"  2>/dev/null | tail -1`
42
    done
74
SERVER_SERVICES=`samba-tool testparm --parameter-name="server services"  2>/dev/null | tail -1`
75
DCERPC_ENDPOINT_SERVERS=`samba-tool testparm --parameter-name="dcerpc endpoint servers"  2>/dev/null | tail -1`
76
DISABLE_NETBIOS=`samba-tool testparm --parameter-name="disable netbios"  2>/dev/null | tail -1`
77
78
if [ "$SERVER_ROLE" != "active directory domain controller" ] \
79
        && ( echo "$SERVER_SERVICES" | grep -qv '\(^\|, \)smb\(,\|$\)' ) \
80
        && ( echo "$DCERPC_ENDPOINT_SERVERS" | grep -qv '\(^\|, \)remote\(,\|$\)' ) \
81
        && ( echo "$DCERPC_ENDPOINT_SERVERS" | grep -qv '\(^\|, \)mapiproxy\(,\|$\)' ) \
82
; then
83
    mask_services "Samba is not being run as an AD Domain Controller" samba-ad-dc.service
84
fi
85
if [ "$SERVER_ROLE" = "active directory domain controller" ]; then
86
    mask_services "Samba is being run as an AD Domain Controller" smbd.service # Not in UCS: nmbd.service
87
elif [ "$DISABLE_NETBIOS" = Yes ]; then
88
    mask_services "NetBIOS is disabled" nmbd.service
43
fi
89
fi
44
90
45
# remove old spool directory (point it to /var/tmp if in use)
91
# remove old spool directory (point it to /var/tmp if in use)

Return to bug 56187