#!/bin/sh # # --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # Please add additional copyright information _after_ the line containing # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # # ROCK Linux: rock-src/package/base/sysfiles/system.init # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. A copy of the GNU General Public # License can be found at Documentation/COPYING. # # Many people helped and are helping developing ROCK Linux. Please # have a look at http://www.rocklinux.org/ and the Documentation/TEAM # file for details. # # --- ROCK-COPYRIGHT-NOTE-END --- # # Desc: System state save and restore # Runlevel: 07 rcX rc1 rc2 rc3 rc4 rc5 # main_begin block_begin(start, `Refresh utmp, delete lock and tmp files and other stuff.') find /var/lock /var/run /tmp -mindepth 1 -print0 2> /dev/null | xargs --null rm -rf rm -f /etc/nologin /nologin /fastboot ; echo -n >> /var/run/utmp chmod 664 /var/run/utmp ; chown root:tty /var/run/utmp mkdir /tmp/.ICE-unix /var/lock/subsys chmod 1777 /tmp/.ICE-unix dnl block_split(`Writing /var/log/boot.msg.') check(`dmesg > /var/log/boot.msg') dnl block_split(`Initializing kernel random number generator.') if [ -e /var/state/random-seed ] ; then check(`cat /var/state/random-seed >/dev/urandom') fi block_end block_begin(stop, `Saving /var/log/init.msg and /var/log/boot.msg.') check(`echo -n >> /var/log/init.msg') check(`echo -n >> /var/log/boot.msg') check(`mv /var/log/init.msg /var/log/init.old') check(`mv /var/log/boot.msg /var/log/boot.old') block_split(`Writing a wtmp record.') if [ "$RUNLEVEL" = 0 ] ; then check(`halt -w') else check(`reboot -w') fi block_split(`Saving kernel random seed.') check(`dd if=/dev/urandom of=/var/state/random-seed count=1 2>/dev/null') block_end main_end