Codebase list sysvinit / d88b2c0
debian: sysvinit postinst creates compat initctl link unconditionally Roger Leigh 11 years ago
2 changed file(s) with 13 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
11
22 [ Roger Leigh ]:
33 * initscripts postinst calls urandom, not urandom.sh (Closes: #698966).
4 * sysvinit postinst unconditionally creates a compatibility initctl
5 link to ensure the migration to /run won't fail (Closes: #663009).
46
57 -- Roger Leigh <rleigh@debian.org> Sat, 26 Jan 2013 12:09:29 +0000
68
2222
2323 # Create /run/initctl if not present, and also create compatibility
2424 # symlinks
25 if [ "$INITCTL" ] && [ ! -p "$INITCTL" ]
25 if [ ! -p "$INITCTL" ]
2626 then
2727 # Create new control channel
2828 echo "sysvinit: creating $INITCTL"
2929 rm -f $INITCTL
3030 mkfifo -m 600 $INITCTL
3131
32 # Replace old control channel (if present) with symlink
33 if [ -e "$OLDINITCTL" ]; then
34 ln -s "$INITCTL" "$OLDINITCTL.new"
35 mv "$OLDINITCTL.new" "$OLDINITCTL"
36 fi
32 # Replace old control channel with symlink
33 ln -s "$INITCTL" "$OLDINITCTL.new"
34 mv "$OLDINITCTL.new" "$OLDINITCTL"
3735
3836 # Reopen control channel (uses new channel).
39 if ! ischroot && [ -n "$PID" ]
37 if ! ischroot
4038 then
4139 kill -s USR1 "$PID"
4240 fi
4846 cp -p /usr/share/sysvinit/inittab /etc/inittab
4947 fi
5048
51 # Tell init to re-exec itself. We loop on failure because to reduce
52 # the chance of a race before the new control channel is opened.
53 if ! ischroot && [ -n "$PID" ]
49 # Tell init to re-exec itself. We loop on failure to reduce
50 # the chance of a race before the new control channel is
51 # opened.
52 if ! ischroot
5453 then
5554 echo -n "sysvinit: restarting..."
5655 for delay in 0 1 2 3 4 5 6 fail;
7069 fi
7170 done
7271 else
73 if [ -n "$PID" ]
74 then
75 echo "Not restarting sysvinit: chroot detected"
76 else
77 echo "Not restarting sysvinit: init not running"
78 fi
72 echo "Not restarting sysvinit: chroot detected"
7973 fi
8074
8175 # Remove old pipe if present. No longer in use after re-exec.
82 if [ "$OLDINITCTL" ] && [ -p "$OLDINITCTL" ]
76 if [ -p "$OLDINITCTL" ]
8377 then
8478 rm -f "$OLDINITCTL"
8579 fi