[Bug 470672] Re: mythbuntu starts frontend to fast

schaze schazet at gmail.com
Tue Nov 17 18:15:51 UTC 2009


Hi Guys,

I have another (ugly) solution for this problem now...

To describe my scenario and make my solution perhaps use full for
others:

I have the following programs that need to be started:

1. mysql (daemon)
2. mythtv-backend (daemon)
3. mythfrontend (application started via autostart in xfce)

Problem:

mysql --> still an old init script
mythtv-backend --> converted to upstart job


When my PC boot the following happens:

mythtv-backend is started very early and tries to connect to mysql, which is not possble as the remaining old init scripts seem to be started after all the upstart jobs. This is no problem as mythtv-backend simply retries to connect until the mysql db is up.
But as GDM was also converted to upstart the userinterface (xfce) is started already before the init scripts are started and so does then the mythfrontend via autostart. As the mythfrontend needs a connection to both, mysql and myth-backend it fails to start properly as it cannot connect to the DB. unlike the backend the frontend does not start to reconnect several times and so I am stuck, as this is thought to be a htpc to watch television and movies in the living room without keyboard and mouse, only IR remote.

I hope this explains the problem.

One solution is to change the script that starts the mythfrontend and
have it wait in a loop until the DB is up. This works fine, however it
kills the whole effect of a fast boot on the new Ubuntu Karmic as I have
to wait about 8-10 seconds after autologin to xfce for the DB.

My second solution I now did is quite simple but also very ugly as it mixes the old init scripts with upstart.
I simply changed the mythtv-backend job in upstart and added to folowing pre-start script:

pre-start script
   /etc/init.d/mysql start
end script

with this the DB is started before the mythtv-backend is started. and it is still done in parallel to any other potential upstart jobs and also before GDM is started. so my problem is solved.
As the mythtv-backend needs to be stopped for changing the base settings but the DB needs to be up I did not simply add mysql to a pre-stop script, but left the old init script for mysql also active. Now the following happens during boot and shutdown:

1. mythtv-backend job is beginning to start
1a. pre-start starts mysql
1b. after pre-start the real job is run and mythtv-backend is started
2. GDM starts
3. mythfrontend starts and can connect
4 between 2 and 3 the mysql init script runs and detects that mysql is already up and does nothing

on shutodwn the mysql database is simply stopped by the old initscript
independand from the mythtv-backend.

I know this is not a very clean thing to do something but it work and it
still has the benefit of a fast boot.

So my problem is solved for now. But I reall hope there will be a mysql
upstart job to have this mess cleaned. This is a real design flaw and
should not stay like that.

Thanks a lot for comments and help,
schaze

-- 
mythbuntu starts frontend to fast
https://bugs.launchpad.net/bugs/470672
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list