services started with eatmydata should remove eatmydata by default
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sysvinit (Ubuntu) |
Fix Released
|
Medium
|
Scott Moser |
Bug Description
when services are started from sysvinit (/etc/init.
One explicit case where it is not expected (most of the time) is eatmydata is used.
The use case that I want to "do the right thing" is:
sudo eatmydata apt-get install mysql
Here, I want apt-get to run with eatmydata (in order to improve performance), but do not want the mysql daemon to start with fsync() disabled.
My solution to this problem is to simply have something clean libeatmydata.so from LD_PRELOAD prior to starting services. I'd support an environment variable NEVER_DISABLE_
It seems the common place for this to be done would be either:
a.) /usr/sbin/service (sysvinit-utils)
b.) invoke-rc.d
Doing this in invoke-rc.d fixes it for the 'dpkg install' path, and is the least invasive path. (fixing 'service' would not actually fix the dpkg install path as invoke-rc.d does not call service).
so, I'd suggest we fix this in invoke-rc.d.
Related bugs:
* bug 1236531: cloud-init support package install with eatmydata
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: sysv-rc 2.88dsf-41ubuntu4
ProcVersionSign
Uname: Linux 3.12.0-4-generic x86_64
ApportVersion: 2.12.7-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Dec 2 14:26:17 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2011-10-19 (775 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
PackageArchitec
SourcePackage: sysvinit
UpgradeStatus: Upgraded to trusty on 2013-05-20 (196 days ago)
In trying to test my fix for this, i went through a few packages before I found one that was actually broken. It seems that many packages (apache2, postgres, anacron) end up cleaning their own environment.
One package that *is* affected is 'backuppc' as demonstrated here:
$ sudo apt-get install --quiet --assume-yes eatmydata /usr/lib/ libeatmydata/ libeatmydata. so /usr/lib/ libeatmydata/ libeatmydata. so
$ sudo eatmydata apt-get install --assume-yes backuppc
$ sudo service backuppc status
* backuppc is running
$ sudo cat /proc/$pid/environ | tr '\0' '\n' | grep ^LD_PRELOAD
LD_PRELOAD=
After the fix is applied, we see:
$ sudo cat /proc/$pid/environ | tr '\0' '\n' | grep ^LD_PRELOAD
LD_PRELOAD=