Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: manit123 on October 21, 2014, 12:25:34 AM

Title: [solved] how to start mysql service via command in startup
Post by: manit123 on October 21, 2014, 12:25:34 AM
hi ,
I want to add entry in startup file so that 'mysql' service does not have to be explicitly selected from system tools > control panel > services .
How can I do that ?
Title: Re: how to start mysql service via command in startup
Post by: Rich on October 21, 2014, 12:35:13 AM
Hi manit123
Go to  /etc/init.d/services  and take a look inside the  mysql  file to see what the start command looks like. Then add it to  bootlocal.sh.
Title: Re: how to start mysql service via command in startup
Post by: manit123 on October 21, 2014, 01:18:17 AM
got it
Quote
tc@box:~$ cd /etc/init.d/services/
tc@box:/etc/init.d/services$ ls
crond  dhcp   mysql  tftpd
tc@box:/etc/init.d/services$ cat mysql
#!/bin/sh

case "${1}" in
    start)
        su -c "cd /usr/local/mysql/bin;./mysqld_multi --log=/var/log/mysql/mysql.log start 1" - tc
        ;;

    stop)
        pkill mysqld
        ;;

    status)
        pidof mysqld
        ;;

    *)
        exit 1
        ;;
esac
Title: Re: how to start mysql service via command in startup
Post by: CentralWare on October 22, 2014, 02:36:48 AM
Code: [Select]
echo "/etc/init.d/services/mysql start" >> bootlocal.sh
Title: Re: how to start mysql service via command in startup
Post by: manit123 on October 22, 2014, 06:36:07 AM
thanks centralware .
it is wise to run /etc/init.d/services/mysql with start option instead of adding  'su -c ...' .
Consider this thread solved.