[mythtv] RFE: Add sql server to settings.

Jan Örnstedt ornstedt at users.sourceforge.net
Tue Sep 21 19:18:35 EDT 2004


Ivan wrote:
>On Tuesday 21 September 2004 05:47 pm, Jan Örnstedt  wrote:
>> A small piece is really missing from making easily distributed packaged
>> mythfrontends.
>>
>> That is updating the mysql.txt.
>>
>> Wouldn't it be great if this could be an additional settings in
>> mythfrontend.
>> And for instance if the db is not answering taking you directly to that
>> config page.
>>
>> How hard would this be to implement?
>
>Isaac has answered this before.  It won't happen, if I remember correctly, 
>cause a frontend doesn't need to talk to a sql server.  It only needs to know 
>what backend to use.  The backend needs to know what its sql server is, 
>though.
>
>Furthermore, mysql.txt may not even be on the same machine as the frontend.
>
>IvanK.

I fail to see this. When looking at the code you will notice that
mythfrontend will exit unless it can connect to the sql server. When
packaging the frontend I definatly need to have mysql.txt preferably in
my ~/.mythtv/ dir. Otherwise I can't watch tv from my other clients.

No where is the backend configured. I recon that it gets this from the
db.

So I still believe this should be integrated to mythfrontend.

/Janne

>From mythfrontend: 
   if (!gContext->OpenDatabase(db))
    {
        printf("couldn't open db\n");
        int pause;
        if ((pause = gContext->GetNumSetting("WOLsqlReconnectWaitTime",
        0)) > 0)
        {
            int acttry = 1;
            int retries = gContext->GetNumSetting("WOLsqlConnectRetry",
            5);

            QString WOLsqlCommand =
            gContext->GetSetting("WOLsqlCommand",
                                                   "echo
                                                   \'WOLsqlServerCommand
                                                   "
                                                   "not set\nPlease do
                                                   so in "
                                                   "your mysql.txt!\'");

            if (!WOLsqlCommand.isEmpty())
            {
                while (acttry <= retries && !gContext->OpenDatabase(db))
                {
                    printf("Trying to wakeup SQLserver (Try %d of
                    %d)\n",
                           acttry, retries);
                    system(WOLsqlCommand);
                    sleep(pause);
                    ++acttry;
                }
            }

            if (WOLsqlCommand.isEmpty() || (acttry > retries))
            {
                printf("Sorry, couldn't open db\nExiting.\n");
                return -1;
            }


More information about the mythtv-dev mailing list