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

Revision 25385, 1.2 KB checked in by jdreed, 13 years ago (diff)
In reactivate: * Stop kexec'ing, because modern distributions are incapable of doing so without sucking
  • 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# Cleanup our ticketenv hack
35# Make sure nobody was evil
36chattr -f -i /tmp/ticketenv || :
37# If you made a directory and stored files there, too bad
38rm -rf /tmp/ticketenv
39
40# If either we or an updated package wanted to reboot, now is a
41# perfectly good time to do so -- auto-update is inhibited during a
42# login session.
43if [ -e /var/run/reboot-required ]; then
44  reboot
45fi
Note: See TracBrowser for help on using the repository browser.