Changeset 10


Ignore:
Timestamp:
08/01/07 12:34:43 (17 years ago)
Author:
adi
Message:

Adrian's patches up to his internal revision r3471.

  • rewrite /etc/default/torque after dpkg-reconfigure
  • stop daemons (move to preinst?)
  • postrm/preinst hooks for dh_makeshlibs not working.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/changelog

    r9 r10  
    44  * Added Build-Depends libpam0g-dev and sed (for debian/patches/apply_patch)
    55  * Removed info.ex and diversion.ex
    6 
    7  -- Adrian Knoth <adi@thur.de>  Thu, 26 Jul 2007 12:14:43 +0200
     6  * added debconf support
     7
     8 -- Adrian Knoth <adi@thur.de>  Tue, 31 Jul 2007 16:38:49 +0200
    89
    910torque (2.1.7p0-1) unstable; urgency=low
  • trunk/postinst

    r9 r10  
    1818
    1919
     20# Source debconf library.
     21. /usr/share/debconf/confmodule
     22
     23
    2024# Also build the tclindexes again for xpbs xpbsmon
    2125#
     
    3337#
    3438create_default_torque_file() {
     39    PBS_SERVER=0
     40    PBS_MOM=0
     41    PBS_SCHED=0
     42
     43    db_get torque/daemon_list
     44
     45    for daemon in $RET; do
     46        daemon=${daemon%,}
     47
     48        case "$daemon" in
     49            pbs_server)
     50                PBS_SERVER=1
     51                ;;
     52            pbs_mom)
     53                PBS_MOM=1
     54                ;;
     55            pbs_sched)
     56                PBS_SCHED=1
     57                ;;
     58        esac
     59    done
     60
    3561  cat > $CONFIG_FILE << EOF
    3662#
     
    3864# created with install of torque
    3965#
    40 # setting default to run pbs_mom. To enable an service
    41 # set the value to 1.
     66# Do not edit this file by hand, use
    4267#
     68#     dpkg-reconfigure -p low torque
    4369#
    44 PBS_MOM=1
    45 PBS_SCHED=0
    46 PBS_SERVER=0
     70# instead
     71
     72PBS_MOM=$PBS_MOM
     73PBS_SCHED=$PBS_SCHED
     74PBS_SERVER=$PBS_SERVER
    4775
    4876PBS_MOM_OPTS=''
     
    5381}
    5482
    55 if [ ! -f $CONFIG_FILE ]
     83
     84if [ "$1" = configure -o ! -f $CONFIG_FILE ]
    5685then
    5786        create_default_torque_file
     
    5988        # If old style config replace it we new one
    6089        #
     90    # adi@2007-07-31: not covered by debconf
    6191        OLD_CONFIG=`awk '/^HOST=/ {  print $0 }'  $CONFIG_FILE`
    6292        if [ ! -z "$OLD_CONFIG" ]
     
    86116
    87117
     118#DEBHELPER#
     119
     120
    88121# Automatically added by dh_installinit
    89122if [ -x "/etc/init.d/torque" ]; then
    90123        update-rc.d torque defaults >/dev/null
    91124        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
     125        if [ "$1" = configure ]; then
     126            invoke-rc.d torque stop || true
     127        fi
    92128                invoke-rc.d torque start || exit 0
    93129        else
     130        if [ "$1" = configure ]; then
     131            /etc/init.d/torque stop || true
     132        fi
    94133                /etc/init.d/torque start || exit 0
    95134        fi
    96135fi
    97136# End automatically added section
     137
     138
  • trunk/postrm

    r5 r10  
    1111then
    1212        /bin/rm $CONFIG_FILE
     13
     14    # if we still have debconf, also remove our entries from the DB
     15    if [ -e /usr/share/debconf/confmodule ]
     16    then
     17        # Source debconf library.
     18        . /usr/share/debconf/confmodule
     19        db_purge
     20    fi
    1321fi
     22
     23
     24#DEBHELPER#
Note: See TracChangeset for help on using the changeset viewer.