Changeset 295 for trunk


Ignore:
Timestamp:
Mar 28, 2008, 9:14:40 PM (17 years ago)
Author:
ecprice
Message:

Improve postinst script to not give errors.

Location:
trunk/packages/sipb-xen-database/sipb-xen-database/debian
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-database/sipb-xen-database/debian/sipb-xen-database-server.postinst

    r81 r295  
    2121case "$1" in
    2222    configure)
    23         # Don't fail if the user/database already exists
    24         su postgres -c 'createuser sipb-xen -S -d -R'    || true
    25         su postgres -c 'createdb sipb_xen -O sipb-xen'   || true
    26         adduser --system sipb-xen
    27 
     23        #Don't create users on upgrade
     24        if [ -z "$2" ]; then
     25            # Don't fail if the user/database already exists
     26            su postgres -c 'createuser sipb-xen -S -d -R'    || true
     27            su postgres -c 'createdb sipb_xen -O sipb-xen'   || true
     28            adduser --system sipb-xen
     29        fi
    2830        su sipb-xen -s /bin/sh -c 'sipb-xen-database-tables create'
    2931    ;;
  • trunk/packages/sipb-xen-database/sipb-xen-database/debian/sipb-xen-database-server.prerm

    r81 r295  
    1919
    2020case "$1" in
    21     remove|upgrade|deconfigure)
     21    remove|deconfigure)
    2222
    2323        # This will destroy data -- do we want to do this?
     
    2727    ;;
    2828
    29     failed-upgrade)
     29    upgrade|failed-upgrade)
    3030    ;;
    3131
Note: See TracChangeset for help on using the changeset viewer.