-
-
Save dxgldotorg/9615aaf7d339115b83978676a3260283 to your computer and use it in GitHub Desktop.
Compile Samba4 for Debian/Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Install Samba4 4.9.0 | |
## On Debian 64Bits | |
## Author: Nilton OS -- www.linuxpro.com.br | |
## Link: https://github.com/jniltinho/go-samba4 | |
## Version: 0.6 | |
### Tested on Debian 8/9 Ubuntu 16.04 64Bits | |
apt-get update | |
apt-get -yq install ruby-dev | |
apt-get -yq install libreadline-dev git build-essential libattr1-dev libblkid-dev libpam0g-dev | |
apt-get -yq install autoconf python-dev python-dnspython libacl1-dev gdb pkg-config libpopt-dev | |
apt-get -yq install libldap2-dev libtirpc-dev libxslt1-dev python-pycryptopp libgnutls28-dev | |
apt-get -yq install dnsutils acl attr libbsd-dev libcups2-dev libgnutls28-dev curl wget | |
apt-get -yq install docbook-xsl libacl1-dev gdb liblmdb-dev libjansson-dev libpam0g-dev libgpgme-dev | |
apt-get -yq install tracker libtracker-sparql-1.0-dev libavahi-client-dev libavahi-common-dev bison flex | |
apt-get -yq install libarchive-dev | |
gem install fpm | |
cd /usr/src | |
get_samba4=https://download.samba.org/pub/samba/stable/samba-4.9.0.tar.gz | |
wget -c ${get_samba4} | |
tar xvfz $(basename ${get_samba4}) | |
cd $(basename ${get_samba4}|sed "s/.tar.gz//") | |
./configure --with-ads --systemd-install-services --with-shared-modules=idmap_ad --enable-debug --enable-selftest --with-systemd --enable-spotlight --prefix=/opt/samba4 | |
make | |
make install | |
echo '[Unit] | |
Description=Samba4 AD Daemon | |
After=syslog.target network.target | |
[Service] | |
Type=forking | |
PIDFile=/opt/samba4/var/run/samba.pid | |
LimitNOFILE=16384 | |
EnvironmentFile=-/etc/sysconfig/samba4 | |
ExecStart=/opt/samba4/sbin/samba $SAMBAOPTIONS | |
ExecReload=/usr/bin/kill -HUP $MAINPID | |
[Install] | |
WantedBy=multi-user.target' > /etc/systemd/system/samba4.service | |
### Add PATH | |
echo 'export PATH=$PATH:/opt/samba4/bin:/opt/samba4/sbin' >> /etc/profile | |
source /etc/profile | |
### Add start script on boot | |
# systemctl daemon-reload | |
# systemctl enable samba4.service | |
# systemctl start samba4.service | |
### To use Samba4 acls, add the following mount options to your data filesystems user_xattr,acl. | |
### If you use xfs you can also add barrier=1 which ensures that tdb transactions are safe against unexpected power loss. | |
## errors=remount-ro | |
### Change fstab | |
# cp /etc/fstab /etc/fstab_$$.bkp | |
# sed -i 's|errors=remount-ro|errors=remount-ro,acl,user_xattr,barrier=1|' /etc/fstab | |
# mount -o remount / | |
### Create User | |
# samba-tool user create nilton --random-password --use-username-as-cn --surname="OS" --given-name="Nilton" [email protected] --job-title="Goes there and back again" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment