Clean up system directories by making samba conform to FHS and by using
subdirectories e.g. /var/log/samba and /var/run/samba instead of
/var/log and /var/run.
Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 mkdir -p /var/cache/samba
 mkdir -p /var/log/samba
 mkdir -p /var/lock/subsys
+mkdir -p /var/run/samba
 
 RETVAL=0
 
        echo -n "Shutting down SMB services: "
        kill -9 `pidof smbd`
        RETVAL=$?
-       rm -f /var/run/smbd.pid
+       rm -f /var/run/samba/smbd.pid
        echo "done"
 
        echo -n "Shutting down NMB services: "
        kill -9 `pidof nmbd`
        RETVAL2=$?
-       rm -f /var/run/nmbd.pid
+       rm -f /var/run/samba/nmbd.pid
 
        [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
        echo "done"
 
        $(if $(BR2_PACKAGE_SAMBA_AVAHI),AVAHI_LIBS=-pthread)
 
 SAMBA_CONF_OPTS = \
-       --with-piddir=/var/run \
-       --with-lockdir=/var/lock \
-       --with-logfilebase=/var/log \
-       --with-configdir=/etc/samba \
-       --with-privatedir=/etc/samba \
+       --with-fhs \
+       --with-piddir=/var/run/samba \
+       --with-lockdir=/var/cache/samba \
+       --with-ncalrpcdir=/var/run/ncalrpc \
+       --with-nmbdsocketdir=/var/run/nmbd \
        \
        --disable-cups \
        --enable-shared-libs \