Re: [Maria-developers] [Maria-discuss] Problem with MariaDb as a Windows service
![](https://secure.gravatar.com/avatar/6856a1f0f722fbef5eef6f496fc6fab3.jpg?s=120&d=mm&r=g)
Same problem with MariaDB 5.1.51. --Peter On Sun, Nov 21, 2010 at 02:43, Vladislav Vaintroub < vladislav.vaintroub@oracle.com> wrote:
Hi, It is likely this bug http://bugs.mysql.com/bug.php?id=56821 , was for some time in MySQL, already fixed.
-----Original Message----- From: maria-developers-bounces+wlad=sun.com@lists.launchpad.net [mailto:maria-developers-bounces+wlad
= sun.com@lists.launchpad.net] On Behalf Of Philip Stoev Sent: Samstag, 20. November 2010 20:04 To: Peter Laursen Cc: maria-discuss@lists.launchpad.net; maria-developers@lists.launchpad.net Subject: Re: [Maria-developers] [Maria-discuss] Problem with MariaDb as a Windows service Hi,
It seems that the service requires the --console option to operate properly.
Here is how I could make it work:
1. In the Services Control panel, open up the properties for the service 2. In the "Start Parameters" box, type "--console" without the quotation marks 3. In the same dialog box, hit Start
Philip Stoev
----- Original Message ----- From: "Peter Laursen"
To: ; Sent: Saturday, November 20, 2010 3:36 PM Subject: [Maria-discuss] Problem with MariaDb as a Windows service Some person claimed here around one week ago that MariaDB would not run as service after "mysqld --install". I replied that it worked for me - but it does not with the latest stable version 5.2.3 (it did with the 5.2.3 RC) (so my apology to this person!)
Windows console output:
C:\maria52\bin>sc delete maria52 [SC] DeleteService LYKKEDES
C:\maria52\bin>mysqld --install maria52 Service successfully installed.
C:\maria52\bin>net start maria52 Tjenesten maria52 starter... Tjenesten maria52 kunne ikke startes.
Der opstod en systemfejl.
Systemfejlen 1067 opstod.
(From Danish --> service could not start --> the system error 1067 occurred)
I have tried with both old datadir and the empty one shipped with mariaDB and also my old my.ini as well as a fresh one. Also I tried to add --defaults-dir to the registry (just in case I had overlooked a my.ini copy in C:\ or C:\Windows) and adding doublequotes key manually like "C:\maria52\bin\mysqld" --defaults-file="C:\maria52\my.ini" maria52
I double checked there are no conflicts wit all settings.
The command "C:\maria52\bin\mysqld" --defaults-file="C:\maria52\my.ini" .. starts the server (also when --defaults-file is omitted) .. but not as a service of course.
Was it tested with the 5.2.3 GA release that it will run as a Windows service? The RC worked as a charm - but the GA will not. Any idea? (I am using Win7, 64 bit, Home Premium)
Peter (Webyog)
---------------------------------------------------------------------------- ----
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
![](https://secure.gravatar.com/avatar/52085aed08baca3cef862d69b897a98b.jpg?s=120&d=mm&r=g)
Looks like the relevant code change and resulting bug was introduced
in Rev: 2502.1070.1
revno: 2502.1070.1
branch nick: 5.1-bugteam-bug29751
timestamp: Wed 2010-08-25 15:47:45 +0700 // the date looks recent enough.
message:
Fixed bug #29751 - do not rename the error log at FLUSH LOGS.
Added open log file with FILE_SHARE_DELETE flag on Windows.
I tracked it down to line 4649 of mysqld.cc:
#ifdef __WIN__
if (!opt_console)
{
if (reopen_fstreams(log_error_file, stdout, stderr)) // ** this
fails when run as a service/without console.
unireg_abort(1); // ** application terminates here!
setbuf(stderr, NULL);
FreeConsole();
}
#endif
Hence the SCM reports that the service terminated unexpectedly.
The problem is that when a process does not have a console allocated
to it, the standard C streams stdout, stderr, etc, are not valid, and
hence _fileno (used inside reopen_fstreams returns -2), which in turn
causes dup2() to fail, and reopen_fstreams() to fail.
-Alex
On Mon, Nov 22, 2010 at 8:43 PM, Peter Laursen
Same problem with MariaDB 5.1.51. --Peter
On Sun, Nov 21, 2010 at 02:43, Vladislav Vaintroub
wrote: Hi, It is likely this bug http://bugs.mysql.com/bug.php?id=56821 , was for some time in MySQL, already fixed.
-----Original Message----- From: maria-developers-bounces+wlad=sun.com@lists.launchpad.net [mailto:maria-developers-bounces+wlad=sun.com@lists.launchpad.net] On Behalf Of Philip Stoev Sent: Samstag, 20. November 2010 20:04 To: Peter Laursen Cc: maria-discuss@lists.launchpad.net; maria-developers@lists.launchpad.net Subject: Re: [Maria-developers] [Maria-discuss] Problem with MariaDb as a Windows service
Hi,
It seems that the service requires the --console option to operate properly.
Here is how I could make it work:
1. In the Services Control panel, open up the properties for the service 2. In the "Start Parameters" box, type "--console" without the quotation marks 3. In the same dialog box, hit Start
Philip Stoev
----- Original Message ----- From: "Peter Laursen"
To: ; Sent: Saturday, November 20, 2010 3:36 PM Subject: [Maria-discuss] Problem with MariaDb as a Windows service Some person claimed here around one week ago that MariaDB would not run as service after "mysqld --install". I replied that it worked for me - but it does not with the latest stable version 5.2.3 (it did with the 5.2.3 RC) (so my apology to this person!)
Windows console output:
C:\maria52\bin>sc delete maria52 [SC] DeleteService LYKKEDES
C:\maria52\bin>mysqld --install maria52 Service successfully installed.
C:\maria52\bin>net start maria52 Tjenesten maria52 starter... Tjenesten maria52 kunne ikke startes.
Der opstod en systemfejl.
Systemfejlen 1067 opstod.
(From Danish --> service could not start --> the system error 1067 occurred)
I have tried with both old datadir and the empty one shipped with mariaDB and also my old my.ini as well as a fresh one. Also I tried to add --defaults-dir to the registry (just in case I had overlooked a my.ini copy in C:\ or C:\Windows) and adding doublequotes key manually like "C:\maria52\bin\mysqld" --defaults-file="C:\maria52\my.ini" maria52
I double checked there are no conflicts wit all settings.
The command "C:\maria52\bin\mysqld" --defaults-file="C:\maria52\my.ini" .. starts the server (also when --defaults-file is omitted) .. but not as a service of course.
Was it tested with the 5.2.3 GA release that it will run as a Windows service? The RC worked as a charm - but the GA will not. Any idea? (I am using Win7, 64 bit, Home Premium)
Peter (Webyog)
---------------------------------------------------------------------------- ----
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
![](https://secure.gravatar.com/avatar/06b8a7f236cf59aa9a83cab1a0551ca8.jpg?s=120&d=mm&r=g)
Hi!
"Alex" == Alex Budovski
writes:
Alex> Looks like the relevant code change and resulting bug was introduced Alex> in Rev: 2502.1070.1 Alex> revno: 2502.1070.1 Alex> branch nick: 5.1-bugteam-bug29751 Alex> timestamp: Wed 2010-08-25 15:47:45 +0700 // the date looks recent enough. Alex> message: Alex> Fixed bug #29751 - do not rename the error log at FLUSH LOGS. Alex> Added open log file with FILE_SHARE_DELETE flag on Windows. Alex> I tracked it down to line 4649 of mysqld.cc: Alex> #ifdef __WIN__ Alex> if (!opt_console) Alex> { Alex> if (reopen_fstreams(log_error_file, stdout, stderr)) // ** this Alex> fails when run as a service/without console. Alex> unireg_abort(1); // ** application terminates here! Alex> setbuf(stderr, NULL); Alex> FreeConsole(); Alex> } Alex> #endif Alex> Hence the SCM reports that the service terminated unexpectedly. Alex> The problem is that when a process does not have a console allocated Alex> to it, the standard C streams stdout, stderr, etc, are not valid, and Alex> hence _fileno (used inside reopen_fstreams returns -2), which in turn Alex> causes dup2() to fail, and reopen_fstreams() to fail. Thanks for the good bug report. I am just now merging MySQL 5.1.53 into MariaDB and they have fixed reopen_fstreams() to take care of this issue. We hope to be able to release 5.1.53 in a few days. After that I will merge the change to MariaDB 5.2 and do a release of this. Regards, Monty
participants (3)
-
Alex Budovski
-
Michael Widenius
-
Peter Laursen