Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have created a second instance of MySQL on the server for replication, if I start the process manually it works but need it to start at bootup.

I used to just do a bash script in the init.d folder but apparently that no longer works on 11.10

Can anyone point me in the right direction? I even copied the mysql service, changed it and tried that but it refused to work.

P.S It is the server edition so only Shell access.

share|improve this question

migrated from stackoverflow.com Nov 17 '11 at 14:15

This question came from our site for professional and enthusiast programmers.

1  
I know upstart isn't really well-documented, but I found the cookbook yesterday -- it looks helpful. –  sarnold Nov 17 '11 at 12:07
    
I'm still putting all my scripts in /etc/init.d and I've never had a problem with them running automatically on boot. Was something supposed to have changed? –  ovangle Nov 17 '11 at 16:06
add comment

2 Answers 2

Converted comment to answer

I'm still putting all my scripts in /etc/init.d and I've never had a problem with them running automatically on boot. Was something supposed to have changed? – ovangle Nov 17 '11 at 16:06

share|improve this answer
add comment

Not sure why you'd want a local replica of the mysql database, but it should be simple enough. You probably just need to create an upstart job file that runs your init.d script after mysql is started, and stops it when mysql is about to stop.

start on started mysql
stop on stopping mysql

pre-start exec /etc/init.d/yourscript start

post-stop exec /etc/init.d/yourscript stop
share|improve this answer
    
@SpamapSFrom Neo - "its a remote MySQL database not the local one but thanks anyways" –  Alaukik Dec 7 '11 at 12:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.