--- bugzilla-2.17.6-r2.ebuild 2004-04-23 20:10:08.000000000 +0300 +++ /tmp/bugzilla-2.17.6-r2.ebuild 2004-05-25 12:03:47.000000000 +0300 @@ -100,8 +100,26 @@ rm bz.cfg.templ.[0-9]* || die - einfo "Setting correct privelegies" - mysql -p mysql --exec="GRANT SELECT,INSERT,UPDATE,DELETE,INDEX, ALTER,CREATE,DROP,REFERENCES ON ${mybugsdb}.* TO ${mybugsuser}@${mybugshost} IDENTIFIED BY '${mybugspwd}'; FLUSH PRIVILEGES;" || die + einfo "Setting correct privileges for bugzilla mysql connection" + echo -n "Please enter login info for user who has grant privileges on ${mybugshost} [$USER]: "; read adminuser + if (test -z $adminuser) ; then adminuser="$USER" ; fi + if [ "$mybugshost" != "localhost" ]; then + echo -n "Client address for bugzilla (at db side) [$(hostname -f)]: "; read clientaddr + if (test -z $clientaddr) ; then clientaddr="$(hostname -f)" ; fi + fi + # this will be default for localhost + if (test -z $clientaddr) ; then clientaddr="${bybugshost}" ; fi + + # if $bugshost == localhost, don't specify -h argument, so local socket can be used. + host=${mybugshost/localhost} + mysql -u ${adminuser} ${host:+-h ${host}} -p mysql --exec="GRANT SELECT,INSERT,UPDATE,DELETE,INDEX, ALTER,CREATE,DROP,REFERENCES ON ${mybugsdb}.* TO ${mybugsuser}@${clientaddr} IDENTIFIED BY '${mybugspwd}'; FLUSH PRIVILEGES;" || { + eerror "Error running query!" + eerror "" + eerror "Please run it manually on ${host}." + eerror "" + eerror " \$ mysql -u ${adminuser} -p mysql --exec=\"GRANT SELECT,INSERT,UPDATE,DELETE,INDEX, ALTER,CREATE,DROP,REFERENCES ON ${mybugsdb}.* TO ${mybugsuser}@${clientaddr} IDENTIFIED BY '${mybugspwd}'; FLUSH PRIVILEGES;\"" + eerror "" + } einfo "Setting the template for localconfig variables" ./checksetup.pl bz.cfg.pl || die @@ -113,9 +131,15 @@ echo -n "Do you want to set a crontab [y/N]" ; read cronyes chmod 750 /var/www/bugzilla/cronset.sh - if ( test $cronyes = "y") ; then su - apache -c /var/www/bugzilla/cronset.sh ; fi + # the permissions have gone to root:nobody, fix them again + # FIXME: remove the first chown -R? chown -R apache:apache /var/www/bugzilla || die + # ah, nevermind, + # /var/www/bugzilla/cronset.sh: line 3: /usr/bin/crontab: Permission denied + # can't run crontab as apache user, so removing the su, and running crontab here + # so the shell and homedir issues are not blockers anymore. + if ( test $cronyes = "y") ; then crontab -u apache ./bugzilla.cron.tab ; fi einfo "Then you just have to :" einfo "append to apache/conf: Include conf/bugzilla.conf"