aboutsummaryrefslogtreecommitdiff
path: root/init.d/migrate-run.in
blob: 02a884df9fbb61d42dd27672b06707deeca00ff0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!@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
}