openrc/init.d/migrate-run.in
William Hubbs b628481701 migrate-run: fix ln calls and migrate directories separately
This is based on a patch submitted by AlphatPC@gmail.com.

Reported-by: AlphatPC@gmail.com
X-Gentoo-Bug: 391945
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=391945
2011-11-27 23:29:22 -06:00

38 lines
619 B
Plaintext

#!@PREFIX@/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Released under the 2-clause BSD license.
description="Migrate /var/run and /var/lock to /run"
depend()
{
before *
after localmount
}
start()
{
einfo "starting $RC_SVCNAME"
return 0
}
stop()
{
einfo "completing /var/run and /var/lock migration."
if [ -d /run ]; then
if [ ! -L /var/lock ]; then
ebegin "Migrating /var/lock to /run"
rm -rf /var/lock
ln -s /run/lock /var/lock
eend 0
fi
if [ ! -L /var/run ]; then
ebegin "Migrating /var/run to /run"
rm -rf /var/run
ln -s /run /var/run
eend 0
fi
fi
return 0
}