Revision 24466,
1.2 KB
checked in by broder, 15 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 | |
---|
10 | set -e |
---|
11 | exec >>/var/log/athena-reactivate 2>&1 |
---|
12 | |
---|
13 | # Stop any daemons that were specifically started inside the |
---|
14 | # chroot |
---|
15 | for daemon in $daemons; do |
---|
16 | invoke-rc.d $daemon restart || [ $? = 100 ] |
---|
17 | done |
---|
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. |
---|
22 | for i in /var/lib/schroot/mount/*; do |
---|
23 | if mountpoint -q "$i"; then |
---|
24 | touch /var/run/reboot-required |
---|
25 | break |
---|
26 | fi |
---|
27 | done |
---|
28 | if [ -n "$USER" -a "$USER" != root ]; then |
---|
29 | if pgrep -u "$USER"; then |
---|
30 | touch /var/run/reboot-required |
---|
31 | fi |
---|
32 | fi |
---|
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. |
---|
37 | if [ -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 |
---|
40 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.