[PATCH 1/8] init: create symlinks /var/run -> /run, /var/lock -> /run/lock

Anton Midyukov antohami at altlinux.org
Sat Nov 30 18:42:21 MSK 2019


See-also: https://bugzilla.altlinux.org/show_bug.cgi?id=35350
---
 .../init/live/image-scripts.d/50-var-run-fix  |  9 ++++++++
 .../init/rescue/image-scripts.d/50-sysvinit   | 16 --------------
 .../rescue/image-scripts.d/50-var-run-fix     |  9 ++++++++
 .../init/rootfs/image-scripts.d/40-sysvinit   | 10 ---------
 .../init/rootfs/image-scripts.d/50-sysvinit   | 22 -------------------
 .../rootfs/image-scripts.d/50-var-run-fix     |  9 ++++++++
 6 files changed, 27 insertions(+), 48 deletions(-)
 create mode 100755 features.in/init/live/image-scripts.d/50-var-run-fix
 delete mode 100755 features.in/init/rescue/image-scripts.d/50-sysvinit
 create mode 100755 features.in/init/rescue/image-scripts.d/50-var-run-fix
 delete mode 100755 features.in/init/rootfs/image-scripts.d/40-sysvinit
 delete mode 100755 features.in/init/rootfs/image-scripts.d/50-sysvinit
 create mode 100755 features.in/init/rootfs/image-scripts.d/50-var-run-fix

diff --git a/features.in/init/live/image-scripts.d/50-var-run-fix b/features.in/init/live/image-scripts.d/50-var-run-fix
new file mode 100755
index 0000000000..57a07b3152
--- /dev/null
+++ b/features.in/init/live/image-scripts.d/50-var-run-fix
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# this was a bunch of dirty complaints
+sed -i 's,/var/run,/run,' /{etc,lib}/tmpfiles.d/*.conf ||:
+
+[ ! -L /var/run ] && rm -r /var/run && ln -s ../run /var/run
+[ ! -L /var/lock ] && rm -r /var/lock && ln -s ../run/lock /var/lock
+
+:
diff --git a/features.in/init/rescue/image-scripts.d/50-sysvinit b/features.in/init/rescue/image-scripts.d/50-sysvinit
deleted file mode 100755
index 6be4c3bd31..0000000000
--- a/features.in/init/rescue/image-scripts.d/50-sysvinit
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-# the part below relates to sysvinit specifically
-rpm -q sysvinit || exit 0
-
-# this was a bunch of dirty complaints
-sed -i 's,/var/run,/run,' /{etc,lib}/tmpfiles.d/*.conf ||:
-
-# https://bugzilla.altlinux.org/35350
-# this FAILS: no symlinks...
-#rm -rf /var/run /var/lock
-# ...so just revert what's been broken in failsystem package
-mkdir -p /var/run /var/lock/{serial,subsys,uucp}
-chmod 0770 /var/lock/subsys
-chmod 0770 /var/lock/{serial,uucp}
-chgrp uucp /var/lock/{serial,uucp}
diff --git a/features.in/init/rescue/image-scripts.d/50-var-run-fix b/features.in/init/rescue/image-scripts.d/50-var-run-fix
new file mode 100755
index 0000000000..57a07b3152
--- /dev/null
+++ b/features.in/init/rescue/image-scripts.d/50-var-run-fix
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# this was a bunch of dirty complaints
+sed -i 's,/var/run,/run,' /{etc,lib}/tmpfiles.d/*.conf ||:
+
+[ ! -L /var/run ] && rm -r /var/run && ln -s ../run /var/run
+[ ! -L /var/lock ] && rm -r /var/lock && ln -s ../run/lock /var/lock
+
+:
diff --git a/features.in/init/rootfs/image-scripts.d/40-sysvinit b/features.in/init/rootfs/image-scripts.d/40-sysvinit
deleted file mode 100755
index 40aeb68bad..0000000000
--- a/features.in/init/rootfs/image-scripts.d/40-sysvinit
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# 40: should run before 50-users in deflogin
-
-# the part below relates to sysvinit specifically
-rpm -q sysvinit || exit 0
-
-# NM-specific group
-case "$GLOBAL_GROUPS" in
-	*_nmconnect*) groupadd -r _nmconnect ||:;;
-esac
diff --git a/features.in/init/rootfs/image-scripts.d/50-sysvinit b/features.in/init/rootfs/image-scripts.d/50-sysvinit
deleted file mode 100755
index 390d490f47..0000000000
--- a/features.in/init/rootfs/image-scripts.d/50-sysvinit
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-# 40: should run before 50-users in deflogin
-
-# the part below relates to sysvinit specifically
-rpm -q sysvinit || exit 0
-
-# NM-specific group
-case "$GLOBAL_GROUPS" in
-	*_nmconnect*) groupadd -r _nmconnect ||:;;
-esac
-
-# this was a bunch of dirty complaints
-sed -i 's,/var/run,/run,' /{etc,lib}/tmpfiles.d/*.conf ||:
-
-# https://bugzilla.altlinux.org/35350
-# this FAILS: no symlinks...
-#rm -rf /var/run /var/lock
-# ...so just revert what's been broken in failsystem package
-mkdir -p /var/run /var/lock/{serial,subsys,uucp}
-chmod 0770 /var/lock/subsys
-chmod 0770 /var/lock/{serial,uucp}
-chgrp uucp /var/lock/{serial,uucp}
diff --git a/features.in/init/rootfs/image-scripts.d/50-var-run-fix b/features.in/init/rootfs/image-scripts.d/50-var-run-fix
new file mode 100755
index 0000000000..57a07b3152
--- /dev/null
+++ b/features.in/init/rootfs/image-scripts.d/50-var-run-fix
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# this was a bunch of dirty complaints
+sed -i 's,/var/run,/run,' /{etc,lib}/tmpfiles.d/*.conf ||:
+
+[ ! -L /var/run ] && rm -r /var/run && ln -s ../run /var/run
+[ ! -L /var/lock ] && rm -r /var/lock && ln -s ../run/lock /var/lock
+
+:
-- 
2.21.0


--------------EF290B6E3886BA29595C5930--


More information about the devel-distro mailing list