Advertisement

Can't get solaris startup script to work.

Started by February 07, 2006 09:14 AM
2 comments, last by johnnyBravo 18 years, 8 months ago
Hi, for Solaris, I'm trying to make MySql automatically startup and shutdown. So I made this script /etc/init.d/mysql

case "$1" in

'start')
/usr/local/mysql/share/mysql/mysql.server start
;;

'stop')
/usr/local/mysql/share/mysql/mysql.server stop
;;

*)
echo "Usage: $0 { start | stop }"
        exit 1
;;

esac
exit 0



Pretty much copied from the scripts already there. And I then called: chmod 755 mysql chmod +x /etc/init.d/mysql But mysql doesn't startup when I reboot, so what step I missing here? Thank you. edit: I installed mysql via source btw, so I don't believe there are any scripts already there. I have also been reading the mysql manuel about this problem, and I am still not exactly sure on what is going wrong. Heres the manual section: Starting and Stopping MySQL Automatically.
How the init scripts get called depends on the varies among different unixes. I'm not sure about Solaris but most Linux distros that have an /etc/init.d directory also have /etc/rc[12345].d directories where each directory contains links to the /etc/init.d files that are to be started/stopped when entering/exiting that runlevel. Most unixes also have a command to modify these directories conveniently. Consult a Solaris administrator's manual if you can't find anything otherwise.
Advertisement
Some info here

The bottom line is:
If you want the script to be started/shutdown in run-level 3,
add a hard link (as described at the bottom of that link) to your script file in /etc/rc3.d/ and /etc/rc2.d/ (the single user mode)

# ln /etc/init.d/mysql /etc/rc3.d/Kmysql
# ln /etc/init.d/mysql /etc/rc2.d/Smysql


I havent read the whole thing, but I think thats all there is to it
Quote: Original post by 255
How the init scripts get called depends on the varies among different unixes. I'm not sure about Solaris but most Linux distros that have an /etc/init.d directory also have /etc/rc[12345].d directories where each directory contains links to the /etc/init.d files that are to be started/stopped when entering/exiting that runlevel. Most unixes also have a command to modify these directories conveniently. Consult a Solaris administrator's manual if you can't find anything otherwise.


Quote: Original post by pulpfist
Some info here


Thanks guys, its all up and running now.

I just hadn't added the links to the rc folders.

This topic is closed to new replies.

Advertisement