source: trunk/debathena/config/reactivate/debian/reactivate @ 24466

Revision 24466, 1.2 KB checked in by broder, 14 years ago (diff)
In reactivate: * Don't kexec back into recovery mode - regardless of whether or not recovery mode was the *very* last thing on the command line.
  • Property svn:executable set to *
Line 
1#!/bin/bash
2#
3# Cleans up after a login snapshot to make the machine ready for the
4# next login.
5#
6# This script may choose to reboot the machine in order to clear
7# user processes or processes using the login snapshot, although
8# that circumstance should be fairly rare.
9
10set -e
11exec >>/var/log/athena-reactivate 2>&1
12
13# Stop any daemons that were specifically started inside the
14# chroot
15for daemon in $daemons; do
16  invoke-rc.d $daemon restart || [ $? = 100 ]
17done
18
19# schroot has already attempted to kill everything inside the chroot,
20# fairly thoroughly. Our job here is to determine if anything is stuck
21# after a kill -9, and reboot.
22for i in /var/lib/schroot/mount/*; do
23  if mountpoint -q "$i"; then
24    touch /var/run/reboot-required
25    break
26  fi
27done
28if [ -n "$USER" -a "$USER" != root ]; then
29  if pgrep -u "$USER"; then
30    touch /var/run/reboot-required
31  fi
32fi
33
34# If either we or an updated package wanted to reboot, now is a
35# perfectly good time to do so -- auto-update is inhibited during a
36# login session.
37if [ -e /var/run/reboot-required ]; then
38  kexec -l /vmlinuz --initrd=/initrd.img --append="$(sed -e 's/\bsingle\b/quiet splash/' /proc/cmdline)" || :
39  reboot
40fi
Note: See TracBrowser for help on using the repository browser.