Lines 100-107
Link Here
|
100 |
|
100 |
|
101 |
rm bz.cfg.templ.[0-9]* || die |
101 |
rm bz.cfg.templ.[0-9]* || die |
102 |
|
102 |
|
103 |
einfo "Setting correct privelegies" |
103 |
einfo "Setting correct privileges for bugzilla mysql connection" |
104 |
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 |
104 |
echo -n "Please enter login info for user who has grant privileges on ${mybugshost} [$USER]: "; read adminuser |
|
|
105 |
if (test -z $adminuser) ; then adminuser="$USER" ; fi |
106 |
if [ "$mybugshost" != "localhost" ]; then |
107 |
echo -n "Client address for bugzilla (at db side) [$(hostname -f)]: "; read clientaddr |
108 |
if (test -z $clientaddr) ; then clientaddr="$(hostname -f)" ; fi |
109 |
fi |
110 |
# this will be default for localhost |
111 |
if (test -z $clientaddr) ; then clientaddr="${bybugshost}" ; fi |
112 |
|
113 |
# if $bugshost == localhost, don't specify -h argument, so local socket can be used. |
114 |
host=${mybugshost/localhost} |
115 |
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;" || { |
116 |
eerror "Error running query!" |
117 |
eerror "" |
118 |
eerror "Please run it manually on ${host}." |
119 |
eerror "" |
120 |
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;\"" |
121 |
eerror "" |
122 |
} |
105 |
|
123 |
|
106 |
einfo "Setting the template for localconfig variables" |
124 |
einfo "Setting the template for localconfig variables" |
107 |
./checksetup.pl bz.cfg.pl || die |
125 |
./checksetup.pl bz.cfg.pl || die |
Lines 113-121
Link Here
|
113 |
|
131 |
|
114 |
echo -n "Do you want to set a crontab [y/N]" ; read cronyes |
132 |
echo -n "Do you want to set a crontab [y/N]" ; read cronyes |
115 |
chmod 750 /var/www/bugzilla/cronset.sh |
133 |
chmod 750 /var/www/bugzilla/cronset.sh |
116 |
if ( test $cronyes = "y") ; then su - apache -c /var/www/bugzilla/cronset.sh ; fi |
|
|
117 |
|
134 |
|
|
|
135 |
# the permissions have gone to root:nobody, fix them again |
136 |
# FIXME: remove the first chown -R? |
118 |
chown -R apache:apache /var/www/bugzilla || die |
137 |
chown -R apache:apache /var/www/bugzilla || die |
|
|
138 |
# ah, nevermind, |
139 |
# /var/www/bugzilla/cronset.sh: line 3: /usr/bin/crontab: Permission denied |
140 |
# can't run crontab as apache user, so removing the su, and running crontab here |
141 |
# so the shell and homedir issues are not blockers anymore. |
142 |
if ( test $cronyes = "y") ; then crontab -u apache ./bugzilla.cron.tab ; fi |
119 |
|
143 |
|
120 |
einfo "Then you just have to :" |
144 |
einfo "Then you just have to :" |
121 |
einfo "append to apache/conf: Include conf/bugzilla.conf" |
145 |
einfo "append to apache/conf: Include conf/bugzilla.conf" |