debian/0000755000000000000000000000000012247747273007205 5ustar debian/patches/0000755000000000000000000000000012222574623010622 5ustar debian/patches/series0000644000000000000000000000007212212336407012031 0ustar hobbit-support.diff interactive.diff escaping-colons.diff debian/patches/hobbit-support.diff0000644000000000000000000000761712222574370014447 0ustar Enables dphys-config to report to hobbit servers Index: dphys-config/dphys-config =================================================================== --- dphys-config.orig/dphys-config 2013-10-01 18:31:05.000000000 +0200 +++ dphys-config/dphys-config 2013-10-01 18:31:05.000000000 +0200 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/dash # /usr/bin/dphys-config - install/update config files and trigger commands # author Neil Franklin, last modification 2013.03.01 # copyright ETH Zuerich Physics Departement, @@ -287,6 +287,87 @@ ${CMD_DEBUG_WAIT} +# Setup hobbit/xymon support +if [ -e /etc/default/hobbit-client ] ; then + . /etc/default/hobbit-client +fi +if [ -n "${HOBBITSERVERS}" -a '(' -x '/usr/lib/hobbit/client/bin/bb' -o -x '/usr/lib/xymon/client/bin/xymon' ')' ] ; then + HOBBITCOLOR=green + HOBBITMESSAGE="" + if [ -x '/usr/lib/hobbit/client/bin/bb' ]; then + HOBBITBBCMD=/usr/lib/hobbit/client/bin/bb + elif [ -x '/usr/lib/xymon/client/bin/xymon' ]; then + HOBBITBBCMD=/usr/lib/xymon/client/bin/xymon + fi + + color_line() { + LOCALCOLOR="$1" + shift + SYSLOGLEVEL="$1" + shift + HOBBITMESSAGE="${HOBBITMESSAGE}&${LOCALCOLOR} $* +" + if [ "${HOBBITCOLOR}" = 'green' ]; then + ${CMD_DEBUG_PRINT} "Setting color to ${LOCALCOLOR}" + HOBBITCOLOR="${LOCALCOLOR}" + elif [ "${HOBBITCOLOR}" = 'yellow' -a "${LOCALCOLOR}" = 'red' ]; then + ${CMD_DEBUG_PRINT} "Setting color to ${LOCALCOLOR}" + HOBBITCOLOR="${LOCALCOLOR}" + fi + ${CMD_DEBUG_PRINT} "color_line: HOBBITCOLOR is ${HOBBITCOLOR}" + logger -t "${BASENAME}" -p user."${SYSLOGLEVEL}" "$*" + } + + hobbit_line() { + HOBBITMESSAGE="${HOBBITMESSAGE}$* +" + ${CMD_DEBUG_PRINT} "hobbit_line: HOBBITCOLOR is ${HOBBITCOLOR}" + logger -t "${BASENAME}" -p user.info "$*" + } + + hobbit_printonly_line() { + HOBBITMESSAGE="${HOBBITMESSAGE}$* +" + ${CMD_DEBUG_PRINT} "hobbit_printonly_line: HOBBITCOLOR is ${HOBBITCOLOR}" + "${CMD_INFO}" "$*" + } + + hobbit_send() { + ${CMD_DEBUG_PRINT} "Sending the following status report (${HOBBITCOLOR}) to ${HOBBITSERVERS}:" + ${CMD_DEBUG_SLEEP} + if [ "${HOBBITCOLOR}" = 'green' ]; then + HOBBITOK="OK" + else + HOBBITOK="NOT OK" + fi + DATE=`date` + HOBBITSTATUS="status+${HOBBITVALIDITY:-2160} ${CLIENTHOSTNAME:-${CONF_CONFNAME}}.${HOBBIT_TESTNAME:-dpc} ${HOBBITCOLOR} ${DATE} dphys-config ${HOBBITOK} + +${HOBBITMESSAGE}" + ${CMD_DEBUG_PRINT} "${HOBBITSTATUS}" + for hobbitserver in ${HOBBITSERVERS}; do + ${HOBBITBBCMD} $hobbitserver "${HOBBITSTATUS}" + done + } + + # something within the system that user does not expect, give up + CMD_LOG_FATAL="color_line red error $0: FATAL:" + # something from users input, user will correct this and continue + CMD_LOG_ERROR="color_line red error $0: ERROR:" + # something we can continue with, but may be wrong, and user may not suspect it + CMD_LOG_WARNING="color_line yellow warning $0: WARNING:" + # something most likely not wrong, but tell user for the odd case it is wrong + CMD_LOG_NOTE="color_line green notice $0: NOTE:" + # normal stuff users expect, so no marking + CMD_LOG_INFO="hobbit_line" + CMD_INFO_PRINT="hobbit_printonly_line" + + # Send hobbit report on exit or error + trap hobbit_send 0 +else + hobbit_send() (:) +fi + # --- spread config file server load # avoid load peak on the file server from over 100 machines at same time @@ -719,6 +800,8 @@ ${CMD_INFO_PRINT} "processing individual config files from the list ..." ${CMD_DEBUG_SLEEP} +trap - 0 + # cut get rid of comments and grep empty lines (may be emptied comment lines) # and allow user to select/filter subset of lines to be processed # IFS= to avoid read doing separator processing (mangles spaces) @@ -726,6 +809,8 @@ cut -f 1 -d '#' "${CONFLIST_PLACE}" | grep -v '^ *$' | \ grep "${CONF_LINEFILTER}" | while IFS= read -r LINE ; do + trap hobbit_send 0 + ${CMD_DEBUG_PRINT} "LINE=${LINE}" ${CMD_DEBUG_WAIT} debian/patches/escaping-colons.diff0000644000000000000000000000501712222573202014533 0ustar Description: Support file names that contain colon, backslash or \n Author: Axel Beckert Index: dphys-config/dphys-config =================================================================== --- dphys-config.orig/dphys-config 2013-09-06 17:01:19.000000000 +0200 +++ dphys-config/dphys-config 2013-09-06 17:05:25.000000000 +0200 @@ -90,24 +90,27 @@ LANG=C export LANG +# Overwrite the builtin echo with the one from GNU coreutils as the +# builtin one parses escape sequences unconditionally. Meh. +alias echo=/bin/echo # --- tidy up some commands, make systematic # stuff that goes wrong, not expected by user, not in data output, use >&2 # so also with $0 in case this script was called by an other script # something within the system that user does not expect, give up -CMD_FATAL="echo $0: FATAL:" +CMD_FATAL="/bin/echo $0: FATAL:" # something from users input, user will correct this and continue -CMD_ERROR="echo $0: ERROR:" +CMD_ERROR="/bin/echo $0: ERROR:" # something we can continue with, but may be wrong, and user may not suspect it -CMD_WARNING="echo $0: WARNING:" +CMD_WARNING="/bin/echo $0: WARNING:" # something most likely not wrong, but tell user for the odd case it is wrong -CMD_NOTE="echo $0: NOTE:" +CMD_NOTE="/bin/echo $0: NOTE:" # normal stuff users expect, so to stdout as normal output, no $0, no marking -CMD_INFO="echo" +CMD_INFO="/bin/echo" # stuff users asked for, so add to stdout as normal output, no $0, but mark it -CMD_DEBUG="echo DEBUG:" +CMD_DEBUG="/bin/echo DEBUG:" # and also put out some permanent messages, in case running as cron/init.d job @@ -947,7 +950,7 @@ fi # place-on-target: put result here - CONFFILE_PLACE="`echo "${LINE}" | cut -f 2 -d ':'`" + CONFFILE_PLACE="`echo "${LINE}" | sed 's/\\\\:/\x00/g;s/[\\]n/\\x6e/g' | cut -f 2 -d ':' | sed -e 's/\x00/:/g'`" # needs to be set, but may be unset if mothing between the first 2 : if [ "`echo "${CONFFILE_PLACE}" | tr -d ' '`" = "" ] ; then ${CMD_ERROR} "config line \"${LINE}\" has no config place" \ @@ -961,7 +964,7 @@ # run post installing (or pre removing) an config file # if no second : on line or nothing after it this is automatically blank # if more than 2 : on line include the rest of them into this with 3- - CMDTRIG="`echo "${LINE}" | cut -f 3- -d ':'`" + CMDTRIG="`echo "${LINE}" | sed 's/\\\\:/\x00/g;s/[\\]n/\\x6e/g' | cut -f 3- -d ':' | sed -e 's/\x00/:/g'`" ${CMD_DEBUG_PRINT} "CONFFILE_NAME=${CONFFILE_NAME}" \ "CONFFILE_PLACE=${CONFFILE_PLACE} CMDTRIG=${CMDTRIG}" debian/patches/interactive.diff0000644000000000000000000002510012222574623013767 0ustar Author: Claude Becker Author: Axel Beckert Description: Adds options -i and -d for interctive and diff mode. Index: dphys-config/dphys-config =================================================================== --- dphys-config.orig/dphys-config 2013-02-11 19:46:13.000000000 +0100 +++ dphys-config/dphys-config 2013-02-11 19:46:13.000000000 +0100 @@ -136,6 +136,18 @@ CMD_INFO_PRINT="${CMD_INFO}" CMD_VERBOSE_PRINT=true +# command to use for viewing diffs in interactive mode +if [ -x /usr/bin/colordiff ] ; then + CMD_DIFF='colordiff -w -u' +else + CMD_DIFF='diff -w -u' +fi + +if [ -x /usr/bin/dwdiff ] ; then + CMD_WDIFF='dwdiff -c' +else + CMD_WDIFF='wdiff' +fi # set debug option controllable stuff if [ "${DEBUG_SLEEP}" = yes ] ; then @@ -211,6 +223,22 @@ shift 1 ;; + i) + # interactive mode: prompt for action before updating file + INTERACTIVE_MODE=true + ;; + + d) + # diff-only mode: show diff of changed files before installing them + DIFF_ONLY_MODE=true + ;; + + w) + # diff+install mode: show diff of changed files before installing them + DIFF_ONLY_MODE=true + WDIFF_MODE=true + ;; + q) # quiet: don't inform user what we are doing CMD_INFO_PRINT=true @@ -244,6 +283,9 @@ options: -c configname: use this set of config files instead of hostname set -f filter filter: only process lines matching this grep regexp + -i interactive mode: prompt for action before updating file + -d diff-only mode: show diff of changed file but don't install them + -w wdiff-only mode: show word-diff of changed file but don't install them -q quiet: don't give user an running report of what we are doing -v verbose: give user detailed running report -D Debug: activate an debug option, see source for operation @@ -738,6 +782,90 @@ } +# --- install new config file + +install_config_file () { + ${CMD_INFO_PRINT} "updating old or installing new config" \ + "${CONFFILE_NAME} as ${CONFFILE_PLACE} ..." + ${CMD_DEBUG_SLEEP} + + cp -pf "${CONFFILE}" "${CONFFILE_PLACE}" + + ${CMD_DEBUG_PRINT} "`ls -al "${CONFFILE_PLACE}"`" + ${CMD_DEBUG_WAIT} + + + # run the facultative postinstall command trigger stuff + if [ "`echo "${CMDTRIG}" | tr -d ' '`" != "" ] ; then + + ${CMD_INFO_PRINT} "triggering postinstall command \"${CMDTRIG}\" ..." + ${CMD_DEBUG_SLEEP} + + # prevent non zero return from user given command from killing us + set +e + sh -c "${CMDTRIG}" + RETVAL="$?" + set -e + if [ "${RETVAL}" != 0 ] ; then + ${CMD_WARNING} "command returned non zero: ${RETVAL}" >&2 + ${CMD_LOG_WARNING} "command returned non zero: ${RETVAL}" + fi + + ${CMD_DEBUG_PRINT} "`ls -al "${CONFFILE_PLACE}"`" + ${CMD_DEBUG_WAIT} + + fi + + return 0 +} + +# --- remove existing config file + +remove_config_file () { + ${CMD_INFO_PRINT} "removing old config file ${CONFFILE_PLACE} ..." + ${CMD_DEBUG_SLEEP} + + # test for only directory name (ends in /), possibly dangerous leftover + if [ "`echo "${CONFFILE_PLACE}" | rev | cut -c 1`" = "/" ] ; then + + ${CMD_WARNING} "would remove entire directory ${CONFFILE_PLACE}," \ + "may be partially edited list file entry, DANGEROUS, leaving it," \ + "add the files name after the / to delete an single file," \ + "remove / after dir name to really delete entire directory" >&2 + ${CMD_LOG_WARNING} "would remove entire directory ${CONFFILE_PLACE}," \ + "may be partially edited list file entry, DANGEROUS, leaving it," \ + "add the files name after the / to delete an single file," \ + "remove / after dir name to really delete entire directory" + + else + + # run the facultative preremove command trigger stuff + if [ "`echo "${CMDTRIG}" | tr -d ' '`" != "" ] ; then + + ${CMD_INFO_PRINT} "triggering preremove command \"${CMDTRIG}\" ..." + ${CMD_DEBUG_SLEEP} + + set +e + sh -c "${CMDTRIG}" + RETVAL="$?" + set -e + if [ "${RETVAL}" != 0 ] ; then + ${CMD_WARNING} "command returned non zero: ${RETVAL}" >&2 + ${CMD_LOG_WARNING} "command returned non zero: ${RETVAL}" + fi + + fi + + ${CMD_INFO_PRINT} "removing config file ${CONFFILE_PLACE} ..." + ${CMD_DEBUG_SLEEP} + + ${CMD_DEBUG_PRINT} "`ls -ald "${CONFFILE_PLACE}"`" + ${CMD_DEBUG_WAIT} + + rm -rf "${CONFFILE_PLACE}" + + fi +} # --- download config file list @@ -922,36 +1050,68 @@ # only if file has changed do we do anything, as for config list if ! diff "${CONFFILE_PLACE}" "${CONFFILE}" > /dev/null ; then - ${CMD_INFO_PRINT} "updating old or installing new file" \ - "${CONFFILE_NAME} as ${CONFFILE_PLACE} ..." - ${CMD_DEBUG_SLEEP} - - cp -pf "${CONFFILE}" "${CONFFILE_PLACE}" - - ${CMD_DEBUG_PRINT} "`ls -al "${CONFFILE_PLACE}"`" - ${CMD_DEBUG_WAIT} - - - # run the facultative postinstall command trigger stuff - if [ "`echo "${CMDTRIG}" | tr -d ' '`" != "" ] ; then - - ${CMD_INFO_PRINT} "triggering postinstall command \"${CMDTRIG}\" ..." - ${CMD_DEBUG_SLEEP} - - # prevent non zero return from user given command from killing us - set +e - sh -c "${CMDTRIG}" - RETVAL="$?" - set -e - if [ "${RETVAL}" != 0 ] ; then - ${CMD_WARNING} "command returned non zero: ${RETVAL}" >&2 - ${CMD_LOG_WARNING} "command returned non zero: ${RETVAL}" - fi + ACTION_EXECUTED=false - ${CMD_DEBUG_PRINT} "`ls -al "${CONFFILE_PLACE}"`" - ${CMD_DEBUG_WAIT} + while [ $ACTION_EXECUTED != true ] ; do + if [ $INTERACTIVE_MODE ] ; then + # prompt user for action + echo "" + printf "Found new version for ${CONFFILE_PLACE}\n" + printf "[i]nstall [d]iff [D]iff+install [w]diff [W]diff+install [s]kip " + ACTION=$(bash --noprofile --norc -c 'read -n 1 ACTION < /dev/tty; echo $ACTION') + echo "" + elif [ $DIFF_ONLY_MODE ] ; then + # default action is to diff-only + if [ $WDIFF_MODE ]; then + ACTION='w' + else + ACTION='d' + fi + else + # default action is to install + ACTION='i' + fi - fi + case $ACTION in + s|n) # skip file + ACTION_EXECUTED=true + echo "Skipping this file and keeping currently installed version." + ;; + i|y) # install file + ACTION_EXECUTED=true + install_config_file + ;; + d) # diff file + if [ $DIFF_ONLY_MODE ]; then + ACTION_EXECUTED=true + fi + ${CMD_DIFF} ${CONFFILE_PLACE} ${CONFFILE} || true + ;; + D) # diff + install file + ACTION_EXECUTED=true + ${CMD_DIFF} ${CONFFILE_PLACE} ${CONFFILE} || true + install_config_file + ;; + w) # wdiff file + if [ $DIFF_ONLY_MODE ]; then + ACTION_EXECUTED=true + fi + ${CMD_WDIFF} ${CONFFILE_PLACE} ${CONFFILE} || true + ;; + W) # wdiff + install file + ACTION_EXECUTED=true + ${CMD_WDIFF} ${CONFFILE_PLACE} ${CONFFILE} || true + install_config_file + ;; + q) # quit + echo "Skipping this and all other pending files." + exit 42 + ;; + *) + echo "Unknown action '$ACTION'." + ;; + esac + done fi @@ -962,49 +1129,39 @@ # only if file still exists do we do anything if [ -e "${CONFFILE_PLACE}" ] ; then - ${CMD_INFO_PRINT} "removing old config file ${CONFFILE_PLACE} ..." - ${CMD_DEBUG_SLEEP} - - # test for only directory name (ends in /), possibly dangerous leftover - if [ "`echo "${CONFFILE_PLACE}" | rev | cut -c 1`" = "/" ] ; then - - ${CMD_WARNING} "would remove entire directory ${CONFFILE_PLACE}," \ - "may be partially edited list file entry, DANGEROUS, leaving it," \ - "add the files name after the / to delete an single file," \ - "remove / after dir name to really delete entire directory" >&2 - ${CMD_LOG_WARNING} "would remove entire directory ${CONFFILE_PLACE}," \ - "may be partially edited list file entry, DANGEROUS, leaving it," \ - "add the files name after the / to delete an single file," \ - "remove / after dir name to really delete entire directory" + ACTION_EXECUTED=false - else - - # run the facultative preremove command trigger stuff - if [ "`echo "${CMDTRIG}" | tr -d ' '`" != "" ] ; then - - ${CMD_INFO_PRINT} "triggering preremove command \"${CMDTRIG}\" ..." - ${CMD_DEBUG_SLEEP} - - set +e - sh -c "${CMDTRIG}" - RETVAL="$?" - set -e - if [ "${RETVAL}" != 0 ] ; then - ${CMD_WARNING} "command returned non zero: ${RETVAL}" >&2 - ${CMD_LOG_WARNING} "command returned non zero: ${RETVAL}" + while [ $ACTION_EXECUTED != true ] ; do + if [ $INTERACTIVE_MODE ] ; then + # prompt user for action + echo "" + printf "Found config file ${CONFFILE_PLACE} to be deleted\n" + printf "[r]emove [v]iew [s]kip " + ACTION=$(bash --noprofile --norc -c 'read -n 1 ACTION < /dev/tty; echo $ACTION') + echo "" + else + # default action is to remove + ACTION='r' fi - fi + case $ACTION in + s|n) # skip file + ACTION_EXECUTED=true + echo "Skipping this file and keeping currently installed version." + ;; + r|y) # remove file + ACTION_EXECUTED=true + remove_config_file + ;; + v) # view file + ${CMD_DIFF} ${CONFFILE_PLACE} /dev/null || true + ;; + *) + echo "Unknown action '$ACTION'." + ;; + esac + done - ${CMD_INFO_PRINT} "removing config file ${CONFFILE_PLACE} ..." - ${CMD_DEBUG_SLEEP} - - ${CMD_DEBUG_PRINT} "`ls -ald "${CONFFILE_PLACE}"`" - ${CMD_DEBUG_WAIT} - - rm -rf "${CONFFILE_PLACE}" - - fi fi debian/default0000644000000000000000000000042412106235326010535 0ustar # Defaults for dphys-config initscript, sourced by /etc/init.d/dphys-config # # This is a POSIX shell fragment # # By default, the init.d script won't start dphys-config inside a # chrooted environment. Change this to "yes" to change this behaviour. START_INSIDE_CHROOT="no" debian/clean0000644000000000000000000000003512106235326010171 0ustar debian/reverse-dphys-config.1debian/lintian-overrides0000644000000000000000000000037412106235326012553 0ustar # According to the upstream author, "authenti*fi*cation" is commonly # used English and therefore English, even if it's not in the OED. dphys-config binary: spelling-error-in-manpage usr/share/man/man1/dphys-config.1.gz authentification authentication debian/README.source0000644000000000000000000000051212106235326011343 0ustar This package uses quilt to manage all modifications to the upstream source. Changes are stored in the source package as diffs in debian/patches and applied during the build. See /usr/share/doc/quilt/README.source for how to apply and unapply patches manually. -- Axel Beckert , Wed, 17 Aug 2011 14:28:03 +0200 debian/compat0000644000000000000000000000000212106235326010364 0ustar 9 debian/watch0000644000000000000000000000013412106235326010215 0ustar version=3 http://neil.franklin.ch/Projects/dphys-config/ ../dphys-config-(\d{8}.*)\.tar\.gz debian/changelog0000644000000000000000000002021312247747273011055 0ustar dphys-config (20130301~current-1) unstable; urgency=low * New upstream snapshot + Refresh patches hobbit-support and interactive. * Upload to unstable again [ Elmar S. Heeb ] * do not start init script on install/upgrade [ Axel Beckert ] * Add patch to be able to escape colons in file names. * Fix lintian warning init.d-script-does-not-source-init-functions * Bump Standards-Version to 3.9.4 (no changes) * Remove reverse-dphys-config again. The interactive patch by Claude suits the purpose far better, hence reverse-dphys-config is no more supported. + Drop build-dependency on help2man and no more suggest SSH clients * Apply wrap-and-sort * Set the distribution of some previous changelog entries (20100216-3 to -6) to "UNRELEASED" to clarify that these releases haven't been uploaded to Debian. * Rename debian/dphys-config.lintian-overrides to debian/lintian-overrides for consistency. * Bump Standards-Version to 3.9.5 (no changes). -- Axel Beckert Thu, 05 Dec 2013 01:53:37 +0100 dphys-config (20130111~current-1) experimental; urgency=low * New upstream snapshot + Remove patches downgrade-download-warning.diff and fix-backtick-quoting.diff, applied upstream. + Refresh the remaining patches. * Remove diff+install commandline options due to non-unique letters. * Clean up debian/rules, use dh style rules. * Use dh-exec to be able to rename files and hence drop the override_dh_install and override_dh_installchangelogs targets. + Add a versioned build-dependency on dh-exec >= 0.6 (due to #698017). + Add a #!dh-exec shebang line to debian/install, make it executable. + Bump debhelper compatibility and build-dependency to 9. * Fix traps in hobbit-support.diff if $HOBBITSERVERS is not defined. * Switch Vcs-* headers to GitHub. * Remove superfluous whitespace change in hobbit-support.diff -- Axel Beckert Mon, 11 Feb 2013 20:01:01 +0100 dphys-config (20100216-6) UNRELEASED; urgency=low * fix backtick preprocessing to allow commands with arguments -- Elmar S. Heeb Thu, 10 Jan 2013 15:49:52 +0100 dphys-config (20100216-5) UNRELEASED; urgency=low * added default stop runlevels in init.d -- Elmar S. Heeb Thu, 10 Jan 2013 14:28:30 +0100 dphys-config (20100216-4) UNRELEASED; urgency=low * downgrade download warnings from WARNING to INFO * added Elmar S. Heeb to uploaders -- Elmar S. Heeb Thu, 10 Jan 2013 12:43:55 +0100 dphys-config (20100216-3) UNRELEASED; urgency=low * Add feature patch for Interactive and Diff mode by Claude Becker. + Mention Hobbit/Xymon reporting and Interactive mode in the long description. * Fix Hobbit/Xymon reporting to not send "green" reports on --help. * Switch to source format "3.0 (quilt)" + Remove quilt build-dependency as well as patch and unpatch targets * Fix lintian warning "init.d-script-does-not-implement-optional-option status" * Bump Standards-Version to 3.9.3 (no changes) -- Axel Beckert Wed, 15 Aug 2012 20:37:53 +0200 dphys-config (20100216-2) UNRELEASED; urgency=low * Add new script reverse-dphys-config + build-depend on help2man for its manpage + suggest openssh-client | ssh-client * debian/rules: replace mkdir + cp by install -D * debian/copyright: + Remove obsolete copyright of findcdroms.c (no more included upstream since 20090926) + Refer to /usr/share/common-licenses/GPL-2 instead of the symbolic link at /usr/share/common-licenses/GPL + Update copyright years and my e-mail address + Reword the section about examples + Mention reverse-dphys-config + Update licensing information of the packaging to explicitly mention version 2 or newer of the GPL. + Always use dash, does not work with bash anymore. Depend on dash (for pre-Squeeze systems) * Bump Standards-Version to 3.9.2 (no changes) * Fix some lintian warnings: + debian-rules-missing-recommended-target + no-upstream-changelog + missing-debian-source-format (now explicitly "1.0" format) * Add support for hobbit reporting + Use quilt patch management -- Axel Beckert Tue, 16 Aug 2011 22:50:36 +0200 dphys-config (20100216-1) unstable; urgency=low * New upstream release - Works even with LANG not set to C or en_* - New debug option LEAVE_WGET_OUTPUT - Fixes some misspellings reported by Lintian 2.3.x - Other not so common spellings won't be fixed by upstream, so let's keep lintian quiet about them by using lintian overrides as suggested on the lintian mailing list. * Fix Lintian warning debhelper-but-no-misc-depends by adding ${misc:Depends} to the dependencies. * Bumped Standards-Version to 3.8.4 (no changes) * Changed the maintainer e-mail address to my debian.org address. * [debian/init.d] Add dependency to $remote_fs due to usage of /usr. -- Axel Beckert Tue, 16 Feb 2010 21:46:39 +0100 dphys-config (20090926-1) unstable; urgency=low * New upstream release - Now works with every web server (e.g. also ACME micro_httpd) - Now handles blanks and backslashes correctly while preprocessing and reading its own configuration file. (Closes: #510910) - Supports file:/// URLs for configuration file locations - Supports configurable temporary directory (defaults to /var/tmp) - Supports mktemp by default if available (also obsoletes mktemp fix from last NMU) - New option -c to override hostname in chrooted environments - Removed bashism fixes from last NMU since they have been intergrated by upstream even though Debian doesn't require them anymore since policy 3.8.1. - Some more bashisms fixed in example scripts plus some bashisms in dphys-config which checkbashism didn't find. (Closes: #530072) - Upstream updated man page to fix a bunch of lintian warnings. - Now throws error if ran unconfigured -> init.d script now also checks the existence of the mandatory CONF_BASEURL setting * New maintainer * Updated e-mail addresses and URLs of upstream website in debian/control and debian/copyright * Added Vcs-* headers. * Bumped Standards-Version to 3.8.3 - Changed all "(C)" to "©" in debian/copyright. * Changed dh_clean -k to dh_prep in debian/rules. - Bumped debhelper compatibility to 7. * Install upstream dphys-config.example as default /etc/dphys-config conffile. * Added a watch file. * Fixed lintian warnings: - debian-rules-ignores-make-clean-error - using-first-person-in-description * Define $(DESTDIR) in debian/rules for better readability * Changed behaviour of init.d script and cronjob: - init.d: Don't start automatically inside a chrooted environment. chrooted() test taken from udev.postinst. - init.d, cron.d: Don't start automatically if no config file has been created by the admin (prevents startup error messages if only installed for personal use of users). * Downgraded Recommends on pciutils to a Suggests. * Removed Recommends on tcc. (An example script often needed on Sarge needed tcc.) * init.d script and cronjob now do nothing if dphys-config has been removed but not purged. (Thanks to Myon for that hint!) -- Axel Beckert Sun, 11 Oct 2009 15:23:32 +0200 dphys-config (20061020-2.1) unstable; urgency=medium * Non-maintainer upload. * bashism in 'dphys-config' script (Closes: #469084) * debian/control: - Bump Standards-Version to 3.7.3. - Use Homepage: field for upstream URL. -- Chris Lamb Sat, 12 Apr 2008 04:33:12 +0100 dphys-config (20061020-2) unstable; urgency=low * Set start script priority to 21. -- Gürkan Sengün Wed, 31 Jan 2007 13:32:27 +0100 dphys-config (20061020-1) unstable; urgency=low * New upstream version. * Added a few more examples. -- Gürkan Sengün Thu, 26 Oct 2006 09:19:39 +0200 dphys-config (20060915-1) unstable; urgency=low * Initial release (Closes: #387633) -- Gürkan Sengün Fri, 15 Sep 2006 16:37:40 +0200 debian/copyright0000644000000000000000000000662612222576346011144 0ustar This package was debianized by Gürkan Sengün on Fri, 15 Sep 2006 16:37:40 +0200. It was downloaded from http://neil.franklin.ch/Projects/dphys-config/ Upstream Author: Neil Franklin This software is dual-licensed under the GNU General Public License (GPL), and the modified/non-advertising BSD License (BSD). License (GPL): Copyright © 2005-2006 Neil Franklin This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. License (BSD): Copyright © 2005-2006 Neil Franklin Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The examples are under Public Domain, written by Gürkan Sengün and were downloaded from http://debian.ethz.ch/pub/debian-local/share/kernel/. reverse-dphys-config is Copyright © 2011 Axel Beckert and licensed under the GPL; either version 2 of the License, or (at your option) any later version. See `/usr/share/common-licenses/GPL-2' for the complete license text. The Debian packaging is © 2006, Gürkan Sengün , © 2009-2011 Axel Beckert and is licensed under the GP; either version 2 of the License, or (at your option) any later version. See `/usr/share/common-licenses/GPL-2' for the complete license text. debian/cron.d0000644000000000000000000000127312106235326010277 0ustar # /etc/cron.d/dphys-config - nightly trigger automatic config updates # authors dsbg and franklin, last modification 2006.09.15 # copyright ETH Zuerich Physics Departement # use under either modified/non-advertising BSD or GPL license SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # daily early morning autoupgrade of config files of our systems # after 03:00, when users are assumed to be least active # before 04:00 so that finished long before dphys-admin starts # by 1 hour, because random sleep 0..59min to spread load on pkg server 0 3 * * * root [ -f /etc/dphys-config -a -x /usr/bin/dphys-config ] && /usr/bin/dphys-config cron > /dev/null 2>&1 debian/init.d0000644000000000000000000000624512222572620010305 0ustar #!/bin/sh # /etc/init.d/dphys-config - boot time trigger automatic config updates # authors dsbg, franklin and abe, last modification 2009.06.08 # Copyright ETH Zurich Physics Department # use under either modified/non-advertising BSD or GPL license # this init.d script is intended to be run from rc2.d # on our site it needs to run after rc2.d/S20inetd (and so identd) # else our config file server will disallow requests for config files # on our site it needs to run before rc2.d/S24dphys-admin # else that will not find its /etc/dphys-admin.list config file # so we run it as rc2.d/S22dphys-config ### BEGIN INIT INFO # Provides: dphys-config # Required-Start: $syslog $remote_fs # Required-Stop: $syslog $remote_fs # Should-Start: $local_fs # Should-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Fetch and merge config files, run scripts when they change # Description: Tool to get a list of config files, and for each file # in that list retrieve it from same server and install # it if not yet there. ### END INIT INFO . /lib/lsb/init-functions PATH=/sbin:/bin:/usr/sbin:/usr/bin export PATH # what we are NAME=dphys-config CONFIG=/etc/${NAME} DEFAULT=/etc/default/${NAME} BIN=/usr/bin/${NAME} # exit if dphys-config is not installed (i.e. removed but not purged) [ -x ${BIN} ] || exit 0 # init.d config settings if [ -f ${DEFAULT} ]; then . ${DEFAULT} fi # dphys-config config settings CONF_BASEURL='' if [ -f ${CONFIG} ]; then . ${CONFIG} fi chrooted() { if [ "${START_INSIDE_CHROOT}" != "yes" ]; then if [ -d /proc/1 ]; then if [ `id -u` = 0 ]; then if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then # the devicenumber/inode pair of / is the same as # that of /sbin/init's root, so we're *not* in a # chroot and hence return false return 1 else return 0 fi else echo "$0: chroot test doesn't work as normal user." >&2; exit 3; fi else echo "$0: WARNING: /proc not mounted, assuming chrooted environment." >&2; return 1; fi fi return 0 } case "$1" in start) # Don't start inside a chroot. if ! chrooted; then # Don't start if we don't know where to fetch config updates if [ -f ${CONFIG} ]; then if [ -n "${CONF_BASEURL}" ]; then /bin/echo "Starting ${NAME} automatic config updates ..." # In case system was switched off for a while, run an # upgrade. This will produce output, so no -n in above # echo. ${BIN} init else /bin/echo "No CONF_BASEURL setting found. ${NAME} not updating configs ..." fi else /bin/echo "/etc/${NAME} not found. ${NAME} not updating configs ..." fi else /bin/echo "Running inside a chrooted environment. ${NAME} not updating configs ..." fi /bin/echo "done." ;; stop|default-stop) /bin/echo "'Stopping' ${NAME} automatic config updates (does nothing)." ;; restart|reload|force-reload|status) /bin/echo "No daemon to (force-)re[start|load] or check in ${NAME}" ;; *) /bin/echo "Usage: $0 {start}" exit 1 ;; esac exit 0 debian/examples0000644000000000000000000000002512106235326010724 0ustar dphys-config.example debian/docs0000644000000000000000000000001312106235326010033 0ustar FAQ README debian/control0000644000000000000000000000235712233457321010602 0ustar Source: dphys-config Section: admin Priority: optional Maintainer: Axel Beckert Uploaders: Elmar S. Heeb Build-Depends: debhelper (>= 9), dh-exec (>= 0.6) Standards-Version: 3.9.5 Homepage: http://neil.franklin.ch/Projects/dphys-config/ Vcs-Browser: https://github.com/isgphys/dphys-config Vcs-Git: git://github.com/isgphys/dphys-config.git Package: dphys-config Architecture: all Depends: dash, wget, ${misc:Depends} Suggests: pciutils Enhances: hobbit-client, xymon-client Description: Tool to distribute config files This project is aimed at automatically installing (and keeping update) site specific config files on many hosts, after preprocessing them (conditional content and include files and include sections). It also triggers postinstall scripts whenever their associated config file has been changed. It can also remove config files, including running an preremove script before doing so. All this is driven by an simple config file list. . dphys-config is capable of reporting update failure or success to a Xymon (formerly Hobbit) monitoring server. . dphys-config features an interactive mode and a non-interactive diff mode to check what would be updated. debian/README.Debian0000644000000000000000000000052312106235326011227 0ustar dphys-config for Debian ----------------------- This software is used for a lot of Debian GNU/Linux "stable" Workstations at http://www.debian.org/users/edu/ethz_phys Feel free to contact me with your own dphys-config examples that might be useful to others. -- Gürkan Sengün , Fri, 15 Sep 2006 16:37:40 +0200 debian/dirs0000644000000000000000000000001412106235326010045 0ustar etc usr/bin debian/source/0000755000000000000000000000000012106235326010466 5ustar debian/source/format0000644000000000000000000000001412106235326011674 0ustar 3.0 (quilt) debian/install0000755000000000000000000000015412222576122010563 0ustar #!/usr/bin/dh-exec dphys-config.example => etc/dphys-config Logfile => usr/share/doc/dphys-config/changelog debian/NEWS0000644000000000000000000000242312106235326007666 0ustar dphys-config (20090926-1) unstable; urgency=low The behaviour of dphys-config's init.d script and cronjob have been modified: * The init.d script does no more start dphys-config automatically inside a chrooted environment, because while the hostname in a chroot doesn't change, the configuration files you usually want, are different ones. This new behaviour make it possible to install the dphys-config package with debootstrap or xen-create-image from the xen-tools package in automatic installation setups without having to clean up the wrong config files from the newly created host. You can get back the old behaviour (don't check for chroots) by setting START_INSIDE_CHROOT="yes" in /etc/default/dphys-config. * Neither the init.d script nor the default cronjob start dphys-config automatically if no configuration file has been provided since the default values are set in a way that they can't work and the admin has to change them. This new behaviour prevents startup error messages if dphys-config has only been installed for the personal use of users, but not for the maintaining the configuration of the host on which it is being installed. -- Axel Beckert Wed, 03 Jun 2009 20:16:06 +0200 debian/rules0000755000000000000000000000022212222575710010245 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ override_dh_installinit: dh_installinit --no-start