[mythtv-users] mysql does not start as service after reboot

R. G. Newbury newbury at mandamus.org
Fri Oct 19 18:12:31 UTC 2012


On 10/18/2012 06:34 PM, R KANNAN wrote:
>> Date: Wed, 17 Oct 2012 18:08:35 -0700
>> From: Thomas Mashos<thomas at mashos.com>
>> To: Discussion about MythTV<mythtv-users at mythtv.org>
>> Subject: Re:
>> Message-ID:
>>          <CAMtSsR0R=2EfRucsHYPHCZCsw27efBQjHBnKrJ05AnN1cDrARQ at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> On Wed, Oct 17, 2012 at 5:59 PM, R KANNAN<rk111810 at gmail.com>  wrote:
>>> Hello,
>>>
>>> Mytbuntu 12.04: For some reason mysql does mot start after reboot.
>>> When I try start it as service it fails but works fine when I start
>>> the mysqld daemon.
>>>
>>> root at DVR:/etc/init# service mysql start
>>> start: Job failed to start
>>> root at DVR:/etc/init# mysqld&
>>> [1] 2676
>>> root at DVR:/etc/init# 121017 19:14:55 [Note] Plugin 'FEDERATED' is disabled.
>>> 121017 19:14:55 InnoDB: The InnoDB memory heap is disabled
>>> 121017 19:14:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins
>>> 121017 19:14:55 InnoDB: Compressed tables use zlib 1.2.3.4
>>> 121017 19:14:55 InnoDB: Initializing buffer pool, size = 128.0M
>>> 121017 19:14:55 InnoDB: Completed initialization of buffer pool
>>> 121017 19:14:55 InnoDB: highest supported file format is Barracuda.
>>> 121017 19:14:56  InnoDB: Waiting for the background threads to start
>>> 121017 19:14:57 InnoDB: 1.1.8 started; log sequence number 84614783
>>> 121017 19:14:57 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
>>> 121017 19:14:57 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
>>> 121017 19:14:57 [Note] Server socket created on IP: '127.0.0.1'.
>>> 121017 19:14:57 [Note] Event Scheduler: Loaded 0 events
>>> 121017 19:14:57 [Note] mysqld: ready for connections.
>>> Version: '5.5.24-0ubuntu0.12.04.1'  socket:
>>> '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
>>>
>>> Any ideas on how I can correct this? Also the backend does not start
>>> automatically either but starts fine as service. I think it may be
>>> because of mysql not starting as above.
>>>
>>> Thanks
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users at mythtv.org
>>> http://www.mythtv.org/mailman/listinfo/mythtv-users
>>
>> Do the mysql logs indicate why they aren't starting via the service command?
>>
>> Thanks,
>>
>> Thomas Mashos
>>
> I found the following in my syslog:
>
> Oct 18 18:23:02 DVR kernel: [10598.240534] init: mysql pre-start
> process (4992) terminated with status 1
>
> My /etc/init/mysql.conf has the following
>
> pre-start script
>      #Sanity checks
>      [ -r $HOME/my.cnf ]
>      [ -d /var/run/mysqld ] || install -m 755 -o mysql -g root -d /var/run/mysqld
>      /lib/init/apparmor-profile-load usr.sbin.mysqld
>      LC_ALL=C BLOCKSIZE= df --portability /var/lib/mysql/. | tail -n 1
> | awk '{ exit ($4<4096) }'
> end script
>
> I do not have /var/run/mysqld directory and it seems to have
>
> mysqld.pid  mysqld.sock
>
> I removed them and restarted the service. But I still get the same error.

You do not state your distro so this may not quite be correct:

Use an editor to look at your /etc/rc.d/init.d/mysql file. This is the 
file that 'service' calls.
The 'start' stanza actually calls a couple of scripts. On Fedora these are

/usr/libexec/mysqld-prepare-db-dir    followed by
/usr/bin/mysqld_safe      (which starts mysqld itself) and
/usr/libexec/mysqld-wait-ready

These are intended to check the sanity of your setup: that you have, for 
example, /var/run/mysql and /var/lib/mysql folders and that the 
permissions are set properly (generally,   ownership= mysql:mysql and 
permissions are at least 755 for the directory.

(Note /var/lib/mysql is where Fedora puts your databases. YMMV).

After that you might consider stopping your app-armor instance or at 
least comment it out of the pre-start script, to ensure that it is not 
the problem.

G.










More information about the mythtv-users mailing list