|
From: Heiko Z. <he...@zu...> - 2012-03-17 15:03:58
|
> -----Original Message----- > From: Dominic Raferd [mailto:dl...@ed...] > Sent: Friday, March 16, 2012 6:37 AM > To: dev...@li... > Subject: Re: [Devil-Linux-discuss] mysql on 1.6.0-RC2 and newer > > > > On 15/03/2012 14:24, Dominic Raferd wrote: > > On 15/03/2012 13:21, Heiko Zuerker wrote: > >> Quoting Dominic Raferd<dl...@ed...>: > >> > >>> On 15/03/2012 13:03, Heiko Zuerker wrote: > >>>> Hey, > >>>> > >>>> is anybody using 1.6.0-RC2 (or the current CVS version) together with > mysql? > >>> yes (1.6.0-RC2-server x86) > >>> > >>>> If yes, is your mysql server starting on boot? > >>> yes, but I had to run mysql_upgrade (try: man mysql_upgrade)... > >> I did that. > >> I get the following error in the mysql.err file: > >> ----------------------------------------- > >> 120315 08:18:15 mysqld_safe mysqld from pid file /var/run/mysql.pid > >> ended > >> 120315 08:18:57 mysqld_safe Starting mysqld daemon with databases > >> from /var/mysql > >> 120315 8:18:58 [ERROR] Fatal error: Please read "Security" section > >> of the manual to find out how to run mysqld as root! > >> > >> 120315 8:18:58 [ERROR] Aborting > >> ----------------------------------------- > >> > >> When I start it on the command line via the init script, then it > >> works fine and runs under the mysql user. > >> > >> I have this specified in the config file: > >> MYSQL_PARM="--user=mysql --pid-file=/var/run/mysql.pid -- > datadir=/var/mysql" > >> > > Hmm, it works for me. I have: > > MYSQL_PARM="--user=mysql --pid-file=/var/run/mysql.pid > > --datadir=/home/mysql --tmpdir=/home/bigtmp" > > > > So I guess in your case, but not mine, mysqld_safe is not picking up > > $MYSQL_PARM correctly? Has there been a change in CVS to > > /etc/init.d/mysqld or to /usr/bin/mysqld_safe? > > I think I caught this one. The reason for the problem is that variable $USER is > not defined when mysqld starts at boot time (it should be 'root'). If you use > the standard my.cnf (at /etc-cds/my.cnf and thence > /etc/my.cnf) this doesn't matter because it defines user=mysql in [mysqld] > section. But if you have a bespoke /etc/my.cnf without this definition, then > mysqld is started up without any specified user and so it falls back to using > the current user (root), and this then throws the error. [I confirmed this by > testing.] > > If having $USER undefined at boot is 'by design' or unavoidable then > /usr/bin/mysqld_safe can be patched to work thus: > > sed -i 's/"$USER" = "root"/`id -u` -eq 0/' mysqld_safe > > I've tested this and it works. Otherwise, if (as seems better to me) $USER can > be defined before /etc/init.d/mysqld runs at boot time (as presumably it > used to be before 1.6.0?), this patch should be unnecessary. I like your fix better actually. Applied to CVS. Thanks ! :) > At the end of working this out, I foolishly did rm /etc/init.d/mysqld (instead > of rm /shm/etc-mods/init.d/mysqld) and now I can't restore the correct link- > type to the underlying file at /etc-cd/init.d/mysqld (I've used a symbolic link > but this isn't right I know). Can anyone help me do this? Honestly I have no clue... :( I'd just copy the one from /etc-cd/ over. It'll get fixed during the next upgrade. -- Regards Heiko Zuerker http://www.devil-linux.org |