~percona-dev/percona-server/release-5.5.11-20.2-fix-bug-764138

« back to all changes in this revision

Viewing changes to build/debian/percona-server-server-5.5.postinst

  • Committer: Ignacio Nin
  • Date: 2011-03-19 08:50:37 UTC
  • mfrom: (91.1.1 release-5.5.9-20.1)
  • Revision ID: ignacio.nin@percona.com-20110319085037-llxjusfhpgjxvt3u
debian packaging update and testing

Tested and updated the debian packaging. Changes include:
- Import patches to dpatch system
- Polish control file
- Polish rules file
- Polish post-install scripts
- Move installation from /opt/percona to /usr
- Add builscript for debian
- Downgrade format to 1.0 in order to conform to requirements

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
6
6
${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
7
7
 
8
 
PERCONA_PREFIX=/opt/percona/percona-server-5.5
 
8
PERCONA_PREFIX=/usr
9
9
export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin:$PERCONA_PREFIX/bin
10
10
 
11
11
# This command can be used as pipe to syslog. With "-s" it also logs to stderr.
13
13
 
14
14
invoke() {
15
15
  if [ -x /usr/sbin/invoke-rc.d ]; then
16
 
    invoke-rc.d percona-server $1
 
16
    invoke-rc.d mysql $1
17
17
  else
18
 
    /etc/init.d/percona-server $1
 
18
    /etc/init.d/mysql $1
19
19
  fi
20
20
}
21
21
 
22
 
MYSQL_BOOTSTRAP="${PERCONA_PREFIX}/bin/mysqld --bootstrap --user=mysql --skip-grant-tables"
 
22
MYSQL_BOOTSTRAP="${PERCONA_PREFIX}/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables"
23
23
 
24
24
test_mysql_access() {
25
25
       mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1
62
62
    
63
63
case "$1" in
64
64
  configure)
65
 
    mysql_datadir=${PERCONA_PREFIX}/share/mysql
 
65
    mysql_datadir=${PERCONA_PREFIX}/share/Percona-Server-5.5
66
66
    mysql_statedir=/var/lib/mysql
67
67
    mysql_rundir=/var/run/mysqld
68
68
    mysql_logdir=/var/log
139
139
    # Debian: beware of the bashisms... 
140
140
    # Debian: can safely run on upgrades with existing databases 
141
141
    set +e
142
 
    /bin/bash ${PERCONA_PREFIX}/bin/mysql_install_db --rpm 2>&1 | $ERR_LOGGER
 
142
    /bin/bash ${PERCONA_PREFIX}/bin/mysql_install_db --user=mysql --rpm 2>&1 |
 
143
        $ERR_LOGGER
143
144
    if [ "$?" != "0" ]; then
144
145
      echo "ATTENTION: An error has occured. More info is in the syslog!"
145
146
    fi
175
176
        echo "host     = localhost"                                        >>$dc
176
177
        echo "user     = debian-sys-maint"                                 >>$dc
177
178
        echo "password = $pass"                                            >>$dc
178
 
        echo "socket   = $mysql_rundir/mysqld.sock"                        >>$dc
 
179
        echo "socket   = /var/run/mysqld/mysqld.sock"                      >>$dc
179
180
        echo "[mysql_upgrade]"                                             >>$dc
180
181
        echo "host     = localhost"                                        >>$dc
181
182
        echo "user     = debian-sys-maint"                                 >>$dc
182
183
        echo "password = $pass"                                            >>$dc
183
 
        echo "socket   = $mysql_rundir/mysqld.sock"                        >>$dc
 
184
        echo "socket   = /var/run/mysqld/mysqld.sock"                      >>$dc
184
185
        echo "basedir  = ${PERCONA_PREFIX}"                                >>$dc
185
186
    fi
186
187
    # If this dir chmod go+w then the admin did it. But this file should not.