[Pkg-samba-maint] Another ubuntu patch: reload samba when interfaces are bringed up

Christian Perrier bubulle at debian.org
Sat Mar 15 11:13:35 UTC 2008

This one seems less questionable to me.

A recent Ubuntu patch, discussed in
seems quite OK to me, but still for 3.0.28a-2:

  * debian/samba.if-up
     - ifup hook to reload samba once the interfaces comes up. (LP: #180493)

This involves adding debian/samba.if-up and the following to
debian/rules at the end of the install: target:

       mkdir -p $(DESTDIR)/etc/network/if-up.d
        install -o root -g root debian/samba.if-up $(DESTDIR)/etc/network/if-up.d/samba

I changed the Ubuntu script to use invoke-rc.d instead of direct calls
to /etc/init.d/samba

Advices? Comments?


-------------- next part --------------
#! /bin/sh
# Reload the Samba server when an interface comes up, to allow it to start
# listening on new addresses.
# Based on a similar script for openssh-server

set -e

# Don't bother to restart samba when lo is configured.
if [ "$IFACE" = lo ]; then
	exit 0

# Only run from ifup.
if [ "$MODE" != start ]; then
	exit 0

# Samba only cares about inet and inet6. Get thee gone, strange people
# still using ipx.
if [ "$ADDRFAM" != inet ] && [ "$ADDRFAM" != inet6 ]; then
	exit 0

if [ -x "/etc/init.d/samba" ]; then
	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
		invoke-rc.d samba reload || exit $?
		/etc/init.d/samba reload || exit $?

exit 0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-samba-maint/attachments/20080315/777f33de/attachment.pgp 

More information about the Pkg-samba-maint mailing list