玄箱HGメモ:Debian:etch化保管ファイル内容

Last-modified: 2009-05-09 (土) 19:33:39
Last update: 2009-05-09 (土) 19:33:39
実施: 2008/12/15

玄箱HGメモ:Debian:etch化保管ファイル内容

緑文字が入力コマンド。


Debian etch化

etch化

現バージョンを残したファイルの内容

KAGUYA:~# cat /etc/init.d/halt[ENTER]

/etc/init.d/halt表示画面(例)

#! /bin/sh
#
# halt          Execute the halt command.
#
# Version:      @(#)halt  2.85-22  19-Jun-2004  miquels@cistron.nl
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
echo -n "EEEE" > /dev/ttyS1
# Get the default from /etc/default/halt.
[ -f /etc/default/halt ] && . /etc/default/halt
if [ "$INIT_HALT" = "" ]
then
        case "$HALT" in
                [Pp]*)
                        INIT_HALT=POWEROFF
                        ;;
                [Hh]*)
                        INIT_HALT=HALT
                        ;;
                *)
                        INIT_HALT=POWEROFF
                        ;;
        esac
fi
# See if we need to cut the power.
if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
then
        /etc/init.d/ups-monitor poweroff
fi
# Don't shut down drives if we're using RAID.
hddown="-h"
if grep -qs '^md.*active' /proc/mdstat
then
        hddown=""
fi
# If INIT_HALT=HALT don't poweroff.
poweroff="-p"
if [ "$INIT_HALT" = "HALT" ]
then
        poweroff=""
fi
halt -d -f -i $poweroff $hddown
: exit 0

KAGUYA:~# cat /etc/init.d/halt.dpkg-dist[ENTER]

/etc/init.d/halt.dpkg-dist表示画面(例)

#! /bin/sh
### BEGIN INIT INFO
# Provides:          halt
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:      0
# Short-Description: Execute the halt command.
# Description:
### END INIT INFO
NETDOWN=yes
PATH=/sbin:/usr/sbin:/bin:/usr/bin
[ -f /etc/default/halt ] && . /etc/default/halt
. /lib/lsb/init-functions
do_stop () {
        if [ "$INIT_HALT" = "" ]
        then
                case "$HALT" in
                  [Pp]*)
                        INIT_HALT=POWEROFF
                        ;;
                  [Hh]*)
                        INIT_HALT=HALT
                        ;;
                  *)
                        INIT_HALT=POWEROFF
                        ;;
                esac
        fi
        # See if we need to cut the power.
        if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
        then
                /etc/init.d/ups-monitor poweroff
        fi
        # Don't shut down drives if we're using RAID.
        hddown="-h"
        if grep -qs '^md.*active' /proc/mdstat
        then
                hddown=""
        fi
        # If INIT_HALT=HALT don't poweroff.
        poweroff="-p"
        if [ "$INIT_HALT" = "HALT" ]
        then
                poweroff=""
        fi
        # Make it possible to not shut down network interfaces,
        # needed to use wake-on-lan
        netdown="-i"
        if [ "$NETDOWN" = "no" ]; then
                netdown=""
        fi
        log_action_msg "Will now halt"
        halt -d -f $netdown $poweroff $hddown
}
case "$1" in
  start)
        # No-op
        ;;
  restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
  stop)
        do_stop
        ;;
  *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac
:

KAGUYA:~# cat /etc/init.d/reboot[ENTER]

/etc/init.d/reboot表示画面(例)

#! /bin/sh
#
# reboot        Execute the reboot command.
#
# Version:      @(#)reboot  2.75  22-Jun-1998  miquels@cistron.nl
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
echo -n "CCCC" > /dev/ttyS1
echo -n "Rebooting... "
reboot -d -f -i
#hr
KAGUYA:~# &color(green){cat /etc/init.d/reboot.dpkg-dist};&color(cyan){[ENTER]};
/etc/init.d/reboot.dpkg-dist表示画面(例)
#hr
#! /bin/sh
### BEGIN INIT INFO
# Provides:          reboot
# Required-Start:
# Required-Stop:
# Should-Start:
# Default-Start:
# Default-Stop:      6
# Short-Description: Execute the reboot command.
# Description:
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/lsb/init-functions
do_stop () {
        # Message should end with a newline since kFreeBSD may
        # print more stuff (see #323749)
        log_action_msg "Will now restart"
        reboot -d -f -i
}
case "$1" in
  start)
        # No-op
        ;;
  restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
  stop)
        do_stop
        ;;
  *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac

コメント