From c03f4f6e8c4b3c87bb551fe9136aa5e6232a33db82d5ec7952bc8e2e732beabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= Date: Mon, 13 Oct 2014 14:09:43 +0000 Subject: [PATCH 1/3] This is a clean following r109. - Remove dead code associated with cifstab file which is no longer used. OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/cifs-utils?expand=0&rev=114 --- cifs-utils.changes | 5 ++ cifs.init | 122 ++++++++++++--------------------------------- 2 files changed, 36 insertions(+), 91 deletions(-) diff --git a/cifs-utils.changes b/cifs-utils.changes index b167879..52ead37 100644 --- a/cifs-utils.changes +++ b/cifs-utils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Oct 13 13:42:09 UTC 2014 - lmuelle@suse.com + +- Remove dead code associated with cifstab file which is no longer used. + ------------------------------------------------------------------- Sun Aug 31 19:15:08 UTC 2014 - ddiss@suse.com diff --git a/cifs.init b/cifs.init index beac1db..b2574a1 100644 --- a/cifs.init +++ b/cifs.init @@ -1,9 +1,9 @@ #! /bin/sh -# Copyright (c) 1999-2009 SuSE Linux AG, Nuernberg, Germany. +# Copyright (c) 1999-2014 SUSE Linux Products GmbH, Nuernberg, Germany. # All rights reserved. # # Author: Thomas Fehr, 1999-2001 -# Lars Mueller , 2002-2009 +# Lars Mueller , 2002-2014 # Bjoern Jacke 2004 # # /etc/init.d/cifs @@ -31,21 +31,20 @@ # Should-Stop: nfs nmb # Default-Start: 3 5 # Default-Stop: 0 1 2 6 -# Short-Description: Import remote SMB/ CIFS (MS Windows) file systems -# Description: Import remote SMB/ CIFS (MS Windows) file systems +# Short-Description: Import remote CIFS file systems +# Description: Import remote CIFS file systems ### END INIT INFO -# To access SMB/ CIFS servers beyond the network broadcast domain it may be -# necessary to also activate the nmb service. Also see section 'cifs and nmb -# service' in /usr/share/doc/packages/samba/README.SUSE +# To access CIFS servers beyond the network broadcast domain it may be +# necessary to also activate the nmb service. Also see section 'cifs +# and nmb service' in /usr/share/doc/packages/samba/README.SUSE . /etc/rc.status rc_reset LC_ALL=en_US -CIFSTAB="/etc/samba/cifstab" SMB_CONF="/etc/samba/smb.conf" -CIFS_STATE_FILE="/var/run/cifs" +CIFS_STATE_FILE="/run/cifs.state" SLEEP=1 TIMEOUT=10 @@ -56,94 +55,35 @@ case "$1" in start) grep -q '^[[:space:]]*[^#].*[[:space:]]cifs[[:space:]]' /etc/fstab rc=$? - if [ ! -f ${CIFSTAB} -a ${rc} -ne 0 ]; then - echo -n >&2 "No ${CIFSTAB} found and no type cifs active in /etc/fstab. " + if [ ${rc} -ne 0 ]; then + echo -n >&2 "No filesystem of type cifs active in /etc/fstab. " rc_status -s exit 6 fi echo -n "Mount CIFS File Systems " - service_used="no" - if [ ${rc} -eq 0 ]; then - service_used="yes" - timer=${TIMEOUT} - JOBS="none" - printdot="" - while [ "${JOBS}" ] && [ ${timer} -gt 0 ]; do - if [ -z "${printdot}" ]; then - echo - echo -n "from /etc/fstab " - mount -at cifs >/dev/null & - PID=$! - fi - test -e /proc/$PID || JOBS="" - if [ "${JOBS}" ]; then - timer=$[${timer}-1] - echo -n "." - sleep ${SLEEP} - printdot="yes" - fi - done - test "${printdot}" && echo -n " " - if [ "${JOBS}" -a ${timer} -eq 0 ]; then - echo -n >&2 " Error: timeout while mount. " - rc_failed + timer=${TIMEOUT} + JOBS="none" + printdot="" + while [ "${JOBS}" ] && [ ${timer} -gt 0 ]; do + if [ -z "${printdot}" ]; then + echo -en "\nfrom /etc/fstab " + mount -at cifs >/dev/null & + PID=$! fi - rc_status -v + test -e /proc/$PID || JOBS="" + if [ "${JOBS}" ]; then + timer=$[${timer}-1] + echo -n "." + sleep ${SLEEP} + printdot="yes" + fi + done + test "${printdot}" && echo -n " " + if [ "${JOBS}" -a ${timer} -eq 0 ]; then + echo -n >&2 " Error: timeout while mount. " + rc_failed fi - timer=-1 - test -e ${CIFSTAB} && \ - while read service mountpoint vfstype options; do - case "${service}" in - ""|\#*|\;*) continue ;; - esac - # Set default vfstype which is also a hack for old - # cifstab formated files without a vfstype set. - if [ "${vfstype}" != "cifs" -a -z "${options}" ]; then - options="${vfstype}" - vfstype="cifs" - fi - # If no options are set use an empty password. - if [ -z "${options}" ]; then - options="password=" - fi - if [ ${timer} -eq -1 ]; then - echo -en "from ${CIFSTAB} \n" - timer=0 - fi - # Remove /s at the end of a mount point. - mountpoint=$( echo "$mountpoint"|sed "s/\/*$//") - if grep -q "[[:space:]]$mountpoint[[:space:]]" /proc/mounts; then - echo -n "$mountpoint: mount point already in use. " - rc_status -s - continue - fi - service_used="yes" - echo -n "${service} on ${mountpoint} type ${vfstype} " - rc_reset - timer=${TIMEOUT} - JOBS="none" - printdot="" - while [ "${JOBS}" ] && [ ${timer} -gt 0 ]; do - if [ -z "${printdot}" ]; then - mount -t "${vfstype}" -o ${options} "${service}" "${mountpoint}" >/dev/null & - PID=$! - fi - test -e /proc/$PID || JOBS="" - if [ "${JOBS}" ]; then - timer=$[${timer}-1] - echo -n "." - sleep ${SLEEP} - printdot="yes" - fi - done - test "${printdot}" && echo -n " " - if [ "${JOBS}" -a ${timer} -eq 0 ]; then - echo -n >&2 " Error: timeout while mount. " - rc_failed - fi - rc_status -v - done < ${CIFSTAB} - test "${service_used}" = "no" && rc_status -u + rc_status -v touch ${CIFS_STATE_FILE} ;; stop) From 1c5d1472acc0c871d644af21a0bae3d5fa66855daf94a53f847d0c7d7ae62a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= Date: Mon, 13 Oct 2014 17:58:03 +0000 Subject: [PATCH 2/3] Remove whitespace at EOL. OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/cifs-utils?expand=0&rev=115 --- cifs-utils.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cifs-utils.changes b/cifs-utils.changes index 52ead37..164276e 100644 --- a/cifs-utils.changes +++ b/cifs-utils.changes @@ -33,7 +33,7 @@ Wed Jun 18 19:49:50 UTC 2014 - lmuelle@suse.com ------------------------------------------------------------------- Thu May 8 11:45:19 CEST 2014 - ro@suse.de -- use _rundir macro +- use _rundir macro ------------------------------------------------------------------- Thu Mar 20 19:40:40 UTC 2014 - lmuelle@suse.com From 75291ef7d10d1384f8232f6560a5e9741d763c708ddb77348746f0e7fe121ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= Date: Mon, 13 Oct 2014 22:04:36 +0000 Subject: [PATCH 3/3] Fix broken rccifs symbolic link. OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/cifs-utils?expand=0&rev=116 --- cifs-utils.changes | 5 +++++ cifs-utils.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cifs-utils.changes b/cifs-utils.changes index 164276e..2c59754 100644 --- a/cifs-utils.changes +++ b/cifs-utils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Oct 13 22:01:06 UTC 2014 - lmuelle@suse.com + +- Fix broken rccifs symbolic link. + ------------------------------------------------------------------- Mon Oct 13 13:42:09 UTC 2014 - lmuelle@suse.com diff --git a/cifs-utils.spec b/cifs-utils.spec index a11650c..6b29fc8 100644 --- a/cifs-utils.spec +++ b/cifs-utils.spec @@ -141,7 +141,7 @@ mkdir -p \ ${RPM_BUILD_ROOT}/%{_sbindir} \ ${RPM_BUILD_ROOT}/%{_rundir} install -m 0755 -p ${RPM_SOURCE_DIR}/cifs.init ${RPM_BUILD_ROOT}/%{_sysconfdir}/init.d/cifs -ln -s %{_sysconfdir}/init.d/${cifs_init_script} ${RPM_BUILD_ROOT}/%{_sbindir}/rccifs +ln -s %{_sysconfdir}/init.d/cifs ${RPM_BUILD_ROOT}/%{_sbindir}/rccifs touch ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/%{NET_CFGDIR}/if-{down,up}.d/${script} \ ${RPM_BUILD_ROOT}%{_rundir}/cifs %endif