All pastes #32715 Raw Edit

Anonymous

public text v1 · immutable
#32715 ·published 2005-12-06 22:25 UTC
rendered paste body
service daemon/mysql/initdb {
    need = system/initial system/mountfs net/lo;
    script start = {

                # I'm not sure about this location
                DATA="/data/srv/mysql"

                if [ ! -d $DATA/db/mysql ]
                then
                        if [ ! -d $DATA ]
                        then
                                        mkdir -p $DATA
                                        chown mysql.mysql $DATA
                                        chmod go-rwx $DATA
                        fi
                        su mysql -c "/usr/bin/mysql_install_db 2>&1 > /dev/null"
                fi
                exec [ -f $DATA/db/mysql/db.frm ]
    };

    script stop = {
    };
}

daemon daemon/mysql {
    need = system/initial system/mountfs net/lo;
    use = daemon/mysql/initdb;
    require_network;
    #virtual-use = dns;
        script daemon = {
                /usr/bin/mysqld_safe
                }


        script stop = {

                 ps -ef |grep mysqld_safe
                 status = $?
                 while [ status = 0 ]
                 do
                        killall -9 mysqld_safe
                        ps -ef |grep mysqld_safe
                        status = $?
                        echo "killing mysqld_safe die die die die"
                 done


                ps -ef |grep mysqld
                 status = $?
                 while [ status = 0 ]
                 do
                        killall -9 mysqld
                        ps -ef |grep mysqld
                        status = $?
                        echo "killing mysqld die die die die"
                 done


                exit 0
        }


}