Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 519620 - portage erroneously removing /var/run symlink
Summary: portage erroneously removing /var/run symlink
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Highest blocker (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2014-08-11 07:45 UTC by Austin Wright
Modified: 2015-02-20 01:37 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/var/log/portage/elog/summary.log for dev-db/mysql upgrade (file_519620.txt,751 bytes, text/plain)
2014-08-11 07:45 UTC, Austin Wright
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Austin Wright 2014-08-11 07:45:19 UTC
Created attachment 382662 [details]
/var/log/portage/elog/summary.log for dev-db/mysql upgrade

After upgrading my system, I found my /var/run directory had disappeared, crashing my php-fpm processes, and leaving most services showing as "crashed" and unable to start (even though running).

During the course of upgrading dev-db/mysql, emerge apparently decided that /var/run was an orphaned, and thus removed (See attachment for portage summary.log).

This would likely have been adverted with a fix to Bug 484442, but I can't tell enough to decide exactly what the cause was.
Comment 1 Adam Randall 2014-08-15 10:32:47 UTC
I had the same problem tonight with the upgrade from MySQL 5.1 to 5.5:

 * Messages for package dev-db/mysql-5.1.70:

 * 
 * Directory symlink(s) may need protection:
 * 
 *      /var/run
 * 
 * Searching all installed packages for files installed via above symlink(s)...
 * 
 * The above directory symlink(s) are all safe to remove. Removing them now...
 * 

 * Messages for package dev-db/mysql-5.5.39:

 * MySQL MY_DATADIR is /var/lib/mysql
 * MySQL datadir found in /var/lib/mysql
 * A new one will not be created.
 * You might want to run:
 * "emerge --config =dev-db/mysql-5.5.39"
 * if this is a new install.
 * If you are upgrading major versions, you should run the
 * mysql_upgrade tool.
Comment 2 Brian Evans (RETIRED) gentoo-dev 2014-08-15 12:22:36 UTC
(In reply to Adam Randall from comment #1)
> I had the same problem tonight with the upgrade from MySQL 5.1 to 5.5:
> 
>  * Messages for package dev-db/mysql-5.1.70:
> 
>  * 
>  * Directory symlink(s) may need protection:
>  * 
>  *      /var/run
>  * 
>  * Searching all installed packages for files installed via above
> symlink(s)...
>  * 
>  * The above directory symlink(s) are all safe to remove. Removing them
> now...
>  * 

This is a message saying the OLD mysql 5.1 had a keepdir installed into /var/run/mysqld.   We removed this with 5.5 and portage removed the symlink.

This is not a bug for the mysql team.  We cleaned up the keepdir reference.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2015-02-20 01:08:19 UTC
Portage team:
This bit infra today, breaking one of the gentoo.org boxes (openrc suddenly thought nothing was running, as lots of running programs couldn't find their pre-existing pidfiles).

/var/run and /var/lock SHOULD be whitelisted by Portage, and NEVER removed.
Perhaps NO symlinks in /var should ever be removed, but I'll start wiht just /var/run and /var/lock.

Portage 2.2.8-r1 (hardened/linux/amd64, gcc-4.7.3, glibc-2.19-r1, 3.15.5-hardened-r2-infra29 x86_64)

=====
>>> Messages generated by process 11030 on 2015-02-18 15:11:08 UTC for package www-servers/apache-2.2.27-r4:

LOG: postrm

Directory symlink(s) may need protection:

        /var/run

Searching all installed packages for files installed via above symlink(s)...

The above directory symlink(s) are all safe to remove. Removing them now...

=====
Comment 4 Zac Medico gentoo-dev 2015-02-20 01:25:08 UTC
How about if we add /var/run to the UNINSTALL_IGNORE setting in profiles/base/make.defaults?
Comment 5 Zac Medico gentoo-dev 2015-02-20 01:37:01 UTC
Fixed in cvs:

--- make.defaults
+++ make.defaults
@@ -132,8 +132,9 @@
 # 1) do not uninstall kernel modules and therefore allow replacing them,
 # 2) allow replacing unowned compiled Python modules (python-r1 migration),
 # 3) allow replacing unowned dropin.cache files (twisted-r1 migration).
+# 4) protect /var/{run,lock} symlinks for bug 519620
 COLLISION_IGNORE="/lib/modules/* *.py[co] *\$py.class */dropin.cache"
-UNINSTALL_IGNORE="/lib/modules/*"
+UNINSTALL_IGNORE="/lib/modules/* /var/run /var/lock"
 
 # Andreas K. Hüttel <dilfridge@gentoo.org> (23 Aug 2013)
 # Make emerge messages default to English as per Council decision