1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-24 10:50:22 +03:00

sync packagaing with SAMBA_3_0

(This used to be commit b97f6620aa80df9649775f81055b70146a03ec66)
This commit is contained in:
Gerald Carter 2003-03-29 12:49:54 +00:00
parent dfcf1634bc
commit 054e5daf7c
5 changed files with 630 additions and 220 deletions

View File

@ -10,10 +10,14 @@
# Arguments:
# $1 = file (usually passed with %s from samba)
# $2 = unix prefix to where to place the file (~%u should work)
# $3 = windows prefix to the same location (\\%L\%u should work)
# $3 = windows prefix to the same location (//%L/%u should work)
# $4 = user/computer to send a notification to (%u or %m)
# $5 = IP address of client (%I)
# $6 = Name of destination file without extension (%J)
# $7 = PDF setting (prepress,print,screen etc)
#
# If you want to customise any of the following configuration defaults,
# you can place them in the file /etc/samba/print-pdf.conf.
PS2PDF=ps2pdf13
OPTIONS="-dAutoFilterColorImages=false -sColorImageFilter=FlateEncode"
@ -22,6 +26,13 @@ KEEP_PS=1
PERMS=640
INFILE=$(basename $INPUT)
BASEFILE=pdf-service
PREFIX="$2"
NAME="$6"
WINBASE=$(echo "$3"|sed -e 's,/,\\\\,g')
# Source config file if it exists:
CONFFILE=/etc/samba/print-pdf.conf
[ -e $CONFFILE ] && . $CONFFILE
#make a temp file to use for the output of the PDF
OUTPUT=`mktemp -q $2/$BASEFILE-XXXXXX`
@ -29,30 +40,39 @@ if [ $? -ne 0 ]; then
echo "$0: Can't create temp file $2/$BASEFILE-XXXXXX, exiting..."
exit 1
fi
if [ "$NAME" != "" ]; then
FINALOUTPUT="$PREFIX/$NAME"
else
FINALOUTPUT="$OUTPUT"
fi
if [ "$7" != "" ]; then
OPTIONS="$OPTIONS -dPDFSETTINGS=/${7#pdf-}"
else
OPTIONS="$OPTIONS -dPDFSETTINGS=/default"
fi
WIN_OUTPUT="$3\\`basename $OUTPUT`"
WIN_OUTPUT="$WINBASE\\"`basename "$FINALOUTPUT"`
# create the PDF:
$PS2PDF $OPTIONS $INPUT $OUTPUT.pdf >/dev/null 2>&1
$PS2PDF $OPTIONS $INPUT "$OUTPUT".pdf >/dev/null 2>&1
mv -f "$OUTPUT".pdf "$FINALOUTPUT".pdf
# Generate a message to send to the user, and deal with the original file:
MESSAGE=$(echo "Your PDF file has been created as $WIN_OUTPUT.pdf\n")
if [ $KEEP_PS ];then
mv $INPUT $OUTPUT.ps
mv -f $INPUT "${FINALOUTPUT}".ps
MESSAGE=$(echo "$MESSAGE and your postscript file as $WIN_OUTPUT.ps")
# Fix permissions on the generated files
chmod $PERMS $OUTPUT.ps
chmod $PERMS "${FINALOUTPUT}".ps
else
rm -f $INPUT
chmod $PERMS $OUTPUT.ps $OUTPUT.pdf
chmod $PERMS "${FINALOUTPUT}".ps "${FINALOUTPUT}".pdf
# Fix permissions on the generated files
fi
chmod $PERMS $OUTPUT.ps $OUTPUT.pdf
#Remove empty file from mktemp:
rm -f $OUTPUT
[ "x$NAME" -eq "x" ] && rm -f $OUTPUT
# Send notification to user
echo -e $MESSAGE|smbclient -M $4 -I $5 -U "PDF Generator" >/dev/null 2>&1

File diff suppressed because it is too large Load Diff

View File

@ -77,6 +77,8 @@
# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = pcguest
# Allow users to map to guest:
map to guest = bad user
# Security mode. Most people will want user level security. See
# security_level.txt for details.
@ -212,27 +214,39 @@
; logon home = \\%L\%U\.profile
# The add user script is used by a domain member to add local user accounts
# that have been authenticated by the domain controller, or by the domain
# that have been authenticated by the domain controller.
# Script for domain member for adding local accounts for authenticated users:
; add user script = /usr/sbin/useradd -s /bin/false %u
# The add machine script is use by a samba server configured as a domain
# controller to add local machine accounts when adding machines to the domain.
# The script must work from the command line when replacing the macros,
# or the operation will fail. Check that groups exist if forcing a group.
# Script for domain controller for adding machines:
; add user script = /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M %u
; add machine script = /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M %u
# Script for domain controller with LDAP backend for adding machines (please
# configure in /etc/samba/smbldap_conf.pm first):
; add user script = /usr/share/samba/scripts/smbldap-useradd.pl -w -d /dev/null -g machines -c 'Machine Account' -s /bin/false %u
# Script for domain member for adding local accounts for authenticated users:
; add user script = /usr/sbin/useradd -s /bin/false %u
; add machine script = /usr/share/samba/scripts/smbldap-useradd.pl -w -d /dev/null -g machines -c 'Machine Account' -s /bin/false %u
# Domain groups:
# domain admin group is a list of unix users or groups who are made members
# of the Domain Admin group
; domain admin group = root @wheel
#
# domain guest groups is a list of unix users or groups who are made members
# of the Domain Guests group
; domain guest group = nobody @guest
# Domain groups are now configured by using the smbgroupedit tool
# Samba Password Database configuration:
# Samba now has runtime-configurable password database backends. Multiple
# passdb backends may be used, but users will only be added to the first one
# Default:
; passdb backend = smbpasswd unixsam
# TDB backen with fallback to smbpasswd and unixsam
; passdb backend = tdbsam_nua smbpasswd unixsam
# LDAP with fallback to smbpasswd unixsam
# Enable SSL by using an ldaps url, or enable tls with 'ldap ssl' below.
; passdb backend = ldapsam_nua:ldaps://ldap.mydomain.com smbpasswd unixsam
# Non-unix account range:
# This is a range of unix user-id's that samba will map non-unix RIDs to,
# such as machine accounts, when using a _nua passdb backend
non unix account range = 10000-20000
# LDAP configuration for Domain Controlling:
# The account (dn) that samba uses to access the LDAP server
# This account needs to have write access to the LDAP tree
@ -297,8 +311,8 @@
# UNIX: ISO8859-1 (Western European), ISO8859-2 (Eastern Eu.),
# ISO8859-5 (Russian Cyrillic), KOI8-R (Alt-Russ. Cyril.)
# This is an example for french users:
; client code page = 850
; character set = ISO8859-1
; dos charset = 850
; unix charset = ISO8859-1
#============================ Share Definitions ==============================
@ -372,6 +386,7 @@
browseable = yes
read only = yes
write list = @adm root
guest ok = yes
# A useful application of samba is to make a PDF-generation service
# To streamline this, install windows postscript drivers (preferably colour)
@ -383,7 +398,7 @@
printable = Yes
comment = PDF Generator (only valid users)
#print command = /usr/share/samba/scripts/print-pdf file path win_path recipient IP &
print command = /usr/share/samba/scripts/print-pdf %s ~%u \\\\\\\\%L\\\\%u %m %I &
print command = /usr/share/samba/scripts/print-pdf %s ~%u //%L/%u %m %I "%J" &
# This one is useful for people to share files
;[tmp]

View File

@ -29,7 +29,7 @@ start() {
# If CUPS is used as printing system, reload smb after a 1 minute delay
# to allow the printers to appear properly as samba shares.
if killall -0 cupsd 2>/dev/null; then
( sleep 60 && killproc smbd -HUP ) &
( sleep 60 && killproc smbd -HUP 1>/dev/null) &
fi
export TMPDIR="/var/tmp"
echo -n "Starting SMB services: "

View File

@ -0,0 +1,93 @@
#!/bin/sh
#
# chkconfig: 345 81 45
# description: Starts and stops the Samba wrepld daemon to provide \
# WINS replication services between WINS partner servers.
# Source function library.
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
# Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0
RETVAL=0
start() {
echo -n "Starting WINS Replication services: "
RETVAL=1
if [ "`grep -i 'wins partners' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
daemon wrepld
RETVAL=$?
else
echo "WINS replication is not configured in /etc/samba/smb.conf, not starting"
fi
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/wrepld || \
RETVAL=1
return $RETVAL
}
stop() {
echo -n "Shutting down WINS replication services: "
RETVAL=1
if [ "`grep -i 'wins partners' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
killproc wrepld
RETVAL=$?
fi
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/wrepld
return $RETVAL
}
restart() {
stop
start
}
reload() {
export TMPDIR="/var/tmp"
echo -n "Reloading WINS replication: "
killproc wrepld -HUP
RETVAL=$?
echo
return $RETVAL
}
mdkstatus() {
status wrepld
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
mdkstatus
;;
condrestart)
[ -f /var/lock/subsys/wrepld ] && restart || :
;;
*)
echo "Usage: $0 {start|stop|restart|status|condrestart}"
exit 1
esac
exit $?