Daemon News Ezine BSD News BSD Mall BSD Support Forum BSD Advocacy BSD Updates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]

Finally, after run cron with debug flags and take a look at cron source code,
I found that the problem  is that mysql daemon does not close output pipes and
the following script ,I run from cron, does not force pipes to be closed .

/usr/local/etc/rc.d/mysql-server.sh stop
echo "Start at `date`"
/usr/local/etc/rc.d/mysql-server.sh start 2>&1 > /dev/null
echo "Stop at `date`"

I solve the problem by writing small C program  to close pipes 
and call /usr/local/etc/rc.d/mysql-server.sh

#include <stdio.h>

int main(int argc,char* argv[])
    const char *cmd = "/usr/local/etc/rc.d/mysql-server.sh";
    int i;



    perror("Can not execl");
    return 1;

And change the script to

/usr/local/etc/rc.d/mysql-server.sh stop
echo "Start at `date`"
echo "Stop at `date

Now , every thing work as I expect.

Chatchawan Wongsiriprasert

To Unsubscribe: send mail to majordomo@xxxxxxxxxxx
with "unsubscribe freebsd-stable" in the body of the message