From 762763bd1f43f8792defbbafeb3025ac66890f70 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Wed, 21 Sep 2011 08:52:38 +0200 Subject: [PATCH] Add debian-fixup service that symlinks mtab to /proc/mounts and migrates /var/run and /var/lock to symlinks to /run --- debian/changelog | 2 ++ debian/debian-fixup | 16 ++++++++++++++++ debian/debian-fixup.service | 10 ++++++++++ debian/rules | 1 + debian/systemd.install | 2 ++ debian/systemd.links | 3 +++ 6 files changed, 34 insertions(+) create mode 100644 debian/debian-fixup create mode 100644 debian/debian-fixup.service diff --git a/debian/changelog b/debian/changelog index 6c2f8d3c..69295739 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ systemd (35-1) UNRELEASED; urgency=low [ Tollef Fog Heen ] * New upstream release. Closes: #634618 - Various man page fixes. Closes: #623521 + * Add debian-fixup service that symlinks mtab to /proc/mounts and + migrates /var/run and /var/lock to symlinks to /run [ Michael Biebl ] * Build for libnotify 0.7. diff --git a/debian/debian-fixup b/debian/debian-fixup new file mode 100644 index 00000000..399afb82 --- /dev/null +++ b/debian/debian-fixup @@ -0,0 +1,16 @@ +#! /bin/sh + +set -e + +if [ ! -L /etc/mtab ]; then + ln -sf /proc/mounts /etc/mtab +fi +if [ ! -L /var/run ]; then + rm -rf /var/run + ln -s /run /var/run +fi +if [ ! -L /var/lock ]; then + rm -rf /var/lock + ln -s /run/lock /var/lock +fi +exit 0 diff --git a/debian/debian-fixup.service b/debian/debian-fixup.service new file mode 100644 index 00000000..1a83d58a --- /dev/null +++ b/debian/debian-fixup.service @@ -0,0 +1,10 @@ +[Unit] +Description=Various fixups to make systemd work better on Debian +Before=var-run.mount var-lock.mount +After=var.mount +DefaultDependencies=no + +[Service] +ExecStart=/lib/systemd/debian-fixup +Type=simple +RemainAfterExit=true diff --git a/debian/rules b/debian/rules index 81a876f5..db53e120 100755 --- a/debian/rules +++ b/debian/rules @@ -25,6 +25,7 @@ override_dh_install: rm debian/tmp/lib/security/pam_systemd.la rm debian/tmp/usr/lib/*.la rm debian/tmp/lib/systemd/system/sysinit.target.wants/systemd-vconsole-setup.service + chmod +x debian/debian-fixup dh_install -O--parallel --fail-missing dh_install -plibpam-systemd debian/pam-configs /usr/share dh_install debian/ifup@.service /lib/systemd/system diff --git a/debian/systemd.install b/debian/systemd.install index 7362951a..7b6a27d6 100644 --- a/debian/systemd.install +++ b/debian/systemd.install @@ -36,3 +36,5 @@ usr/lib/tmpfiles.d debian/init-functions lib/lsb debian/lib-init-rw.automount lib/systemd/system/ debian/lib-init-rw.mount lib/systemd/system/ +debian/debian-fixup lib/systemd/ +debian/debian-fixup.service lib/systemd/system diff --git a/debian/systemd.links b/debian/systemd.links index 896ed10e..bf6f69b7 100644 --- a/debian/systemd.links +++ b/debian/systemd.links @@ -52,4 +52,7 @@ # Mount /lib/init/rw during early startup /lib/systemd/system/lib-init-rw.automount /lib/systemd/system/local-fs.target.wants/lib-init-rw.automount +# Run fixups early +/lib/systemd/system/debian-fixup.service /lib/systemd/system/sysinit.target.wants/debian-fixup.service + # TODO: mtab/udev-mtab (symlink /etc/mtab to /proc/self/mounts in postinst) -- 2.39.5