[debian-mysql] Bug#742900: Bug#742900: No mysqld.service File

Clint Byrum spamaps at debian.org
Fri Mar 28 23:17:41 UTC 2014


Excerpts from merc1984's message of 2014-03-28 15:17:22 -0700:
> On Fri, Mar 28, 2014, at 13:25, Clint Byrum wrote:
> > Excerpts from merc1984's message of 2014-03-28 12:20:04 -0700:
> > > 
> > > Package: mysql-server
> > > Version: 5.5-35
> > > 
> > > Implementation of systemd is imminent, yet after days of research I can
> > > not find a mysqld.service file that actually works in Debian.  I've
> > > searched and searched, asked on mailing lists, and asked in IRC on
> > > #debian, #systemd, and #mysql.
> > > 
> > > Nobody knows, or at least nobody helps.  There isn't even a
> > > mysqld.service file in Sid's mysql-server package.
> > > 
> > > I can't use the sysv-dependent systemd service as I have another service
> > > which depends on mysql (mythtv-backend), and it simply does not work
> > > with the kludge.
> > > 
> > > This is a showstopper for me, and probably others.
> > > 
> > 
> > Hi merc. mythtv-backend shouldn't "depend" on the ordering of local
> > MySQL startup anyway. What if you boot your external MySQL server at
> > the same time as mythtv-backend? YOu can't really control the sequence
> > of that ever.
> > 
> > I suggest making mythtv-backend poll like this:
> > 
> > while !mysqladmin ping --host=${mysqlserver} --user=${mysqluser}
> > --password=${mysqlpadd} ; do
> >   echo "MySQL not ready yet."
> >   sleep 5
> > done
> > 
> > Also consider filing a bug in mythtv-backend's upstream code, as it
> > should be able to poll at startup and reconnect on errors as well.
> > 
> > As for a working systemd unit file.. perhaps we can crib from Fedora?
> 
> Can't.  My mythbackend.service also must depend on a device to come
> ready after its firmware is loaded.  And this requires that it be a
> systemd service.  
> 
> Of course Myth should depend on MySQL first starting.  In my
> mythbackend.service I have Requires=mysqld.service and
> After=mysqld.service, so it will wait for mysql to start, no polling
> needed.  And polling is inferior to having systemd handle the
> dependencies.  
> 

I respectfully disagree. Polling handles cross-machine dependencies
whereas systemd dependency handling is limited to ordering of startup on
a single machine. The only advantage systemd ordering gives us is faster
boot.

Since you're likely only interesting in single machine, and boot time
matters to you, I understand that you would like systemd support in
mysqld. But neither method is "superior" or "inferior".

> But in order for systemd to handle it, there must also be a
> mysqld.service service, and nothing I've tried has worked.  I've tried
> to use Fed's mysql.service and Arch's mysql.service, but each has quite
> a different structure than Debian, and I could not get either to work no
> matter how much fiddling.  Finally after days of struggle I gave up and
> filed this bug.
> 

Understood, and we should definitely have a mysqld service file. I would
suggest you work out those differences and write one yourself, or find a
systemd interested person (I am not one) to help with it.



More information about the pkg-mysql-maint mailing list