Skip to content

Commit

Permalink
Release samba-3.6.25-2
Browse files Browse the repository at this point in the history
* Adds winbindd to symlinked binaries
* Fix deb install to run ldconfig to updated lib cache
* Fix deb removal to run ldconfig before starting old daemon
  • Loading branch information
devel committed Dec 6, 2020
1 parent 40fc294 commit a61e03d
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 19 deletions.
6 changes: 4 additions & 2 deletions samba-3.6.25/README
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ results), and then supplied to the build in a config.cache file.
The configure parameters were chosen to provide as much of a
"drop-in" replacement for the existing Samba server as possible,
so that the existing Frontview config files could be used.
As configured, only the smbd/nmbd binaries need to be replaced. All
other libraries and dependencies are located under /usr/local.
As configured, only the smbd/nmbd/winbindd binaries need to be replaced.
All other libraries and dependencies are located under /usr/local.

The full configuration used for the Samba compilation are located
in ../scripts/mods/samba3.mod and built with ../scripts/build
Expand All @@ -30,8 +30,10 @@ then just replace the original binaries in /usr/sbin (as root):

mv /usr/sbin/smbd /usr/sbin/smbd.orig
mv /usr/sbin/nmbd /usr/sbin/nmbd.orig
mv /usr/sbin/winbind /usr/sbin/winbindd.orig
ln -s /usr/local/sbin/smbd /usr/sbin/smbd
ln -s /usr/local/sbin/nmbd /usr/sbin/nmbd
ln -s /usr/local/sbin/winbindd /usr/sbin/winbindd

and then restart the server:

Expand Down
2 changes: 1 addition & 1 deletion samba-3.6.25/SAMBA36/SAMBA36.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<addon>
<name>SAMBA36</name>
<friendly_name>Samba 36</friendly_name>
<version>3.6.25-1</version>
<version>3.6.25-2</version>
<detail_url>https://github.com/sshambar/readynas-arm/</detail_url>
<author>Scott Shambarger</author>
<get_url>SAMBA36_HANDLER.pl</get_url>
Expand Down
4 changes: 2 additions & 2 deletions samba-3.6.25/SAMBA36/SAMBA36_AVAILABLE.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<addon>
<name>SAMBA36</name>
<friendly_name>Samba 36</friendly_name>
<version>3.6.25-1</version>
<version>3.6.25-2</version>
<author>Scott Shambarger</author>
<description>
<en-us>
<![CDATA[Server and Client software to interoperate with Windows machines.]]>
</en-us>
</description>
<detail_url>https://github.com/sshambar/readynas-arm/</detail_url>
<download_url>https://github.com/sshambar/readynas-arm/releases/download/Samba36-3.6.25-1/Samba36_3.6.25-1.bin</download_url>
<download_url>https://github.com/sshambar/readynas-arm/releases/download/Samba36-3.6.25-2/Samba36_3.6.25-2.bin</download_url>
<icon>https://github.com/sshambar/readynas-arm/releases/download/samba-addon/SAMBA36.jpg</icon>
<min_raidiator_version>5.3.1</min_raidiator_version>
</addon>
4 changes: 2 additions & 2 deletions samba-3.6.25/SAMBA36/SAMBA36_CURRENT.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<addon>
<version>3.6.25-1</version>
<download_url>https://github.com/sshambar/readynas-arm/releases/download/Samba36-3.6.25-1/Samba36_3.6.25-1.bin</download_url>
<version>3.6.25-2</version>
<download_url>https://github.com/sshambar/readynas-arm/releases/download/Samba36-3.6.25-2/Samba36_3.6.25-2.bin</download_url>
<message>
<en-us>
<![CDATA[Initial release.]]>
Expand Down
2 changes: 1 addition & 1 deletion samba-3.6.25/SAMBA36/addons.conf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SAMBA36!!Samba 36!!3.6.25-1!!/etc/frontview/addons/bin/SAMBA36/start.sh!!/etc/frontview/addons/bin/SAMBA36/stop.sh!!Other!!current_url==https://github.com/sshambar/readynas-arm/releases/download/samba-addon/SAMBA36_CURRENT.xml::detail_url==https://github.com/sshambar/readynas-arm/
SAMBA36!!Samba 36!!3.6.25-2!!/etc/frontview/addons/bin/SAMBA36/start.sh!!/etc/frontview/addons/bin/SAMBA36/stop.sh!!Other!!current_url==https://github.com/sshambar/readynas-arm/releases/download/samba-addon/SAMBA36_CURRENT.xml::detail_url==https://github.com/sshambar/readynas-arm/
1 change: 1 addition & 0 deletions samba-3.6.25/SAMBA36/running.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ check_symlink() {

check_symlink /usr/local/sbin/smbd /usr/sbin/smbd
check_symlink /usr/local/sbin/nmbd /usr/sbin/nmbd
check_symlink /usr/local/sbin/winbindd /usr/sbin/winbindd

[ -z "$HAS_SYMLINK" ] && exit 1

Expand Down
2 changes: 2 additions & 0 deletions samba-3.6.25/SAMBA36/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ set_symlink() {

backup_file /usr/sbin/smbd
backup_file /usr/sbin/nmbd
backup_file /usr/sbin/winbindd

set_symlink /usr/local/sbin/smbd /usr/sbin/smbd
set_symlink /usr/local/sbin/nmbd /usr/sbin/nmbd
set_symlink /usr/local/sbin/winbindd /usr/sbin/winbindd

SMB2=$(grep "^${SERVICE}_SMB2=" /etc/default/services | sed "s/^${SERVICE}_SMB2=//")
[ -z "$SMB2" ] && SMB2=1 || :
Expand Down
1 change: 1 addition & 0 deletions samba-3.6.25/SAMBA36/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if ! [ "$ENABLED" = 1 ]; then

remove_symlink /usr/local/sbin/smbd /usr/sbin/smbd
remove_symlink /usr/local/sbin/nmbd /usr/sbin/nmbd
remove_symlink /usr/local/sbin/winbindd /usr/sbin/winbindd

if grep -qs "^include = $SAMBA_ADDON_HOME/${SERVICE}.conf" $SAMBA_ADDON_HOME/addons.conf; then
sed -i "/^include = ${SAMBA_ADDON_HOME//\//\/}\/${SERVICE}.conf/d" $SAMBA_ADDON_HOME/addons.conf
Expand Down
2 changes: 1 addition & 1 deletion samba-3.6.25/samba36-addon/DEBIAN/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Priority: extra
Section: checkinstall
Maintainer: Scott Shambarger <devel@shambarger.net>
Architecture: armel
Version: 3.6.25-1
Version: 3.6.25-2
Depends: samba-common
Description: Alternative Samba Suite for ReadyNAS
Provides an alternative Samba Suite installed in /usr/local that
Expand Down
21 changes: 14 additions & 7 deletions samba-3.6.25/samba36-addon/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,29 @@ backup_file() {
[ -f $file -a ! -f ${file}.orig ] && cp -a $file ${file}.orig || :
}

symlink_bin() {
file=$1
rm -f "/usr/sbin/$file"
ln -s "/usr/local/sbin/$file" "/usr/sbin/$file"
}

backup_file /usr/sbin/smbd
backup_file /usr/sbin/nmbd
backup_file /usr/sbin/winbindd

# DISABLE_ACTIVATION skips symlink/restart on install
if [ -z "$DISABLE_ACTIVATION" ]; then

# create symlink to new smbd
rm -f /usr/sbin/smbd
ln -s /usr/local/sbin/smbd /usr/sbin/smbd

# create symlink to new nmbd
rm -f /usr/sbin/nmbd
ln -s /usr/local/sbin/nmbd /usr/sbin/nmbd
# create symlink to new binaries
symlink_bin smbd
symlink_bin nmbd
symlink_bin winbindd

# restart server if running
/etc/init.d/samba status &>/dev/null && /etc/init.d/samba restart || :
fi

# rebuild ld.so.cache (ignore errors)
/sbin/ldconfig || :

exit 0
16 changes: 16 additions & 0 deletions samba-3.6.25/samba36-addon/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

[ "$1" = remove ] || exit 0

# update ld.so.cache (so old libraries are removed)
/sbin/ldconfig || :

if [ -f /tmp/samba36-addon.start ]; then
/etc/init.d/samba start || :
fi

rm -f /tmp/samba36-addon.start

exit 0
12 changes: 9 additions & 3 deletions samba-3.6.25/samba36-addon/DEBIAN/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ remove_symlink() {

remove_symlink /usr/local/sbin/smbd /usr/sbin/smbd
remove_symlink /usr/local/sbin/nmbd /usr/sbin/nmbd
remove_symlink /usr/local/sbin/winbindd /usr/sbin/winbindd

# restart if changes
# stop daemon if changes
if [ -n "$RESTART" ]; then
[ -n "$STOP" ] && ACTION=stop || ACTION=restart
/etc/init.d/samba status &>/dev/null && /etc/init.d/samba $ACTION || :
if /etc/init.d/samba status &>/dev/null; then
/etc/init.d/samba stop || :
# flag postrm to start samba if old binaries were restored
[ -n "$STOP" ] && rm -f /tmp/samba36-addon.start || touch /tmp/samba36-addon.start
else
rm -f /tmp/samba36-addon.start
fi
fi

exit 0

0 comments on commit a61e03d

Please sign in to comment.