On Thu, Sep 30, 2010 at 09:30:25AM +0200, Alex Dupre wrote: > Jeremy Chadwick ha scritto: > > Until rc(8) can be updated to support daemon(8) natively, > > This would be the Right Thing IMHO. > > > the ~76 ports > > which Do The Wrong Thing(tm) should get updated to do it this way. Ones > > like mysqlXX-server should be placed high on the priority list given > > their popularity/importance. > > If you have an already tested patch for the mysql rc script, I'll commit > it asap.
Just finished it for databases/mysql51-server. Tested on RELENG_8 with the below variables in use, and also tested with mysql_limits="yes". mysql_enable="yes" mysql_dbdir="/storage/mysql" mysql_args="--skip-innodb" Should work fine on RELENG_7 since it has /usr/sbin/daemon too. Tested using stop, start, and restart. I can test a reboot if you'd like, just let me know. Validation: icarus# /usr/local/etc/rc.d/mysql-server stop Stopping mysql. Waiting for PIDS: 12015. icarus# /usr/local/etc/rc.d/mysql-server start Starting mysql. icarus# ps -auxwww -U mysql USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND mysql 12271 0.0 0.0 8228 1600 ?? Is 12:53AM 0:00.01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/storage/mysql/my.cnf --user=mysql --datadir=/storage/mysql --pid-file=/storage/mysql/icarus.home.lan.pid --skip-innodb mysql 12352 0.0 0.3 35100 11032 ?? I 12:53AM 0:00.02 [mysqld] I'll also take this opportunity to point this out, since I'm certain someone will mention it: daemon's -u argument would be ideal except that it """breaks""" when using rc.subr's xxx_user variable (which uses su(1) to change credentials/spawn $command). With both in use, daemon then fails on setusercontext(), which in turn fails because of initgroups() returning EPERM -- and this does make sense. So let's not use daemon -u in rc.subr for the time being. The diff is pretty obvious/simple (2 line change), so the other databases/mysqlXX-server ports can be upgraded in the same manner. --- files/mysql-server.sh.in.orig 2010-03-27 03:24:53.000000000 -0700 +++ files/mysql-server.sh.in 2010-09-30 00:45:38.000000000 -0700 @@ -35,8 +35,8 @@ mysql_user="mysql" mysql_limits_args="-e -U ${mysql_user}" pidfile="${mysql_dbdir}/`/bin/hostname`.pid" -command="%%PREFIX%%/bin/mysqld_safe" -command_args="--defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args} > /dev/null 2>&1 &" +command="/usr/sbin/daemon" +command_args="-c -f /usr/local/bin/mysqld_safe --defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}" procname="%%PREFIX%%/libexec/mysqld" start_precmd="${name}_prestart" start_postcmd="${name}_poststart" -- | Jeremy Chadwick j...@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"