summaryrefslogtreecommitdiff
path: root/packages/initscripts/files
diff options
context:
space:
mode:
Diffstat (limited to 'packages/initscripts/files')
-rw-r--r--packages/initscripts/files/arm/alignment.sh6
-rw-r--r--packages/initscripts/files/devpts5
-rw-r--r--packages/initscripts/files/finish.sh6
-rw-r--r--packages/initscripts/files/functions17
-rw-r--r--packages/initscripts/files/halt25
-rw-r--r--packages/initscripts/files/hostname.sh11
-rw-r--r--packages/initscripts/files/reboot11
-rw-r--r--packages/initscripts/files/rmnologin14
-rw-r--r--packages/initscripts/files/save-rtc.sh5
-rw-r--r--packages/initscripts/files/sendsigs17
-rw-r--r--packages/initscripts/files/umountfs18
-rw-r--r--packages/initscripts/files/umountnfs.sh28
-rw-r--r--packages/initscripts/files/volatiles40
13 files changed, 203 insertions, 0 deletions
diff --git a/packages/initscripts/files/arm/alignment.sh b/packages/initscripts/files/arm/alignment.sh
new file mode 100644
index 0000000000..32a9eaace2
--- /dev/null
+++ b/packages/initscripts/files/arm/alignment.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if [ -e /proc/cpu/alignment ] && ! [ $(uname -m) = "armv7l" ]; then
+ echo "3" > /proc/cpu/alignment
+fi
+
diff --git a/packages/initscripts/files/devpts b/packages/initscripts/files/devpts
new file mode 100644
index 0000000000..e10e371662
--- /dev/null
+++ b/packages/initscripts/files/devpts
@@ -0,0 +1,5 @@
+# GID of the `tty' group
+TTYGRP=5
+
+# Set to 600 to have `mesg n' be the default
+TTYMODE=620
diff --git a/packages/initscripts/files/finish.sh b/packages/initscripts/files/finish.sh
new file mode 100644
index 0000000000..4f9f75f47c
--- /dev/null
+++ b/packages/initscripts/files/finish.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if ! test -e /etc/.configured; then
+ > /etc/.configured
+fi
+
diff --git a/packages/initscripts/files/functions b/packages/initscripts/files/functions
new file mode 100644
index 0000000000..fb9a914e4d
--- /dev/null
+++ b/packages/initscripts/files/functions
@@ -0,0 +1,17 @@
+# -*-Shell-script-*-
+#
+# functions This file contains functions to be used by most or all
+# shell scripts in the /etc/init.d directory.
+#
+
+machine_id() { # return the machine ID
+ awk 'BEGIN { FS=": " } /Hardware/ { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo
+}
+
+killproc() { # kill the named process(es)
+ pid=`/bin/ps -e x |
+ /bin/grep $1 |
+ /bin/grep -v grep |
+ /bin/sed -e 's/^ *//' -e 's/ .*//'`
+ [ "$pid" != "" ] && kill $pid
+}
diff --git a/packages/initscripts/files/halt b/packages/initscripts/files/halt
new file mode 100644
index 0000000000..d8cab222ca
--- /dev/null
+++ b/packages/initscripts/files/halt
@@ -0,0 +1,25 @@
+#! /bin/sh
+#
+# halt Execute the halt command.
+#
+# Version: @(#)halt 2.84-2 07-Jan-2002 miquels@cistron.nl
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# See if we need to cut the power.
+if test -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
+
+halt -d -f -i -p $hddown
+
+: exit 0
diff --git a/packages/initscripts/files/hostname.sh b/packages/initscripts/files/hostname.sh
new file mode 100644
index 0000000000..0f3d374286
--- /dev/null
+++ b/packages/initscripts/files/hostname.sh
@@ -0,0 +1,11 @@
+#
+# hostname.sh Set hostname.
+#
+# Version: @(#)hostname.sh 1.10 26-Feb-2001 miquels@cistron.nl
+#
+
+if test -f /etc/hostname
+then
+ hostname -F /etc/hostname
+fi
+
diff --git a/packages/initscripts/files/reboot b/packages/initscripts/files/reboot
new file mode 100644
index 0000000000..56278199be
--- /dev/null
+++ b/packages/initscripts/files/reboot
@@ -0,0 +1,11 @@
+#! /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 "Rebooting... "
+reboot -d -f -i
diff --git a/packages/initscripts/files/rmnologin b/packages/initscripts/files/rmnologin
new file mode 100644
index 0000000000..444145a26a
--- /dev/null
+++ b/packages/initscripts/files/rmnologin
@@ -0,0 +1,14 @@
+#! /bin/sh
+#
+# rmnologin This script removes the /etc/nologin file as the last
+# step in the boot process.
+#
+# Version: @(#)rmnologin 1.00 22-Jun-1998 miquels@cistron.nl
+#
+
+if test -f /etc/nologin.boot
+then
+ rm -f /etc/nologin /etc/nologin.boot
+fi
+
+: exit 0
diff --git a/packages/initscripts/files/save-rtc.sh b/packages/initscripts/files/save-rtc.sh
new file mode 100644
index 0000000000..e786073051
--- /dev/null
+++ b/packages/initscripts/files/save-rtc.sh
@@ -0,0 +1,5 @@
+#! /bin/sh
+/etc/init.d/hwclock.sh stop
+
+# Update the timestamp
+date +%2m%2d%2H%2M%Y > /etc/timestamp
diff --git a/packages/initscripts/files/sendsigs b/packages/initscripts/files/sendsigs
new file mode 100644
index 0000000000..c62a5cd37d
--- /dev/null
+++ b/packages/initscripts/files/sendsigs
@@ -0,0 +1,17 @@
+#! /bin/sh
+#
+# sendsigs Kill all remaining processes.
+#
+# Version: @(#)sendsigs 2.75 22-Jun-1998 miquels@cistron.nl
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# Kill all processes.
+echo "Sending all processes the TERM signal..."
+killall5 -15
+sleep 5
+echo "Sending all processes the KILL signal..."
+killall5 -9
+
+: exit 0
diff --git a/packages/initscripts/files/umountfs b/packages/initscripts/files/umountfs
new file mode 100644
index 0000000000..ec75b0c4a4
--- /dev/null
+++ b/packages/initscripts/files/umountfs
@@ -0,0 +1,18 @@
+#! /bin/sh
+#
+# umountfs Turn off swap and unmount all local filesystems.
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+echo "Deactivating swap..."
+swapoff -a
+
+# We leave /proc mounted.
+echo "Unmounting local filesystems..."
+mount -o remount,ro /mnt/ram
+umount -f -a -r
+
+mount -o remount,ro /
+
+: exit 0
diff --git a/packages/initscripts/files/umountnfs.sh b/packages/initscripts/files/umountnfs.sh
new file mode 100644
index 0000000000..f5fe48aa74
--- /dev/null
+++ b/packages/initscripts/files/umountnfs.sh
@@ -0,0 +1,28 @@
+#! /bin/sh
+#
+# umountnfs.sh Unmount all network filesystems.
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# Write a reboot record to /var/log/wtmp before unmounting
+halt -w
+
+echo "Unmounting remote filesystems..."
+
+test -f /etc/fstab && (
+
+#
+# Read through fstab line by line and unount network file systems
+#
+while read device mountpt fstype options
+do
+ if test "$fstype" = nfs || test "$fstype" = smbfs || test "$fstype" = ncpfs
+ then
+ umount -f $mountpt
+ fi
+done
+) < /etc/fstab
+
+: exit 0
+
diff --git a/packages/initscripts/files/volatiles b/packages/initscripts/files/volatiles
new file mode 100644
index 0000000000..fbcc858226
--- /dev/null
+++ b/packages/initscripts/files/volatiles
@@ -0,0 +1,40 @@
+# This configuration file lists filesystem objects that should get verified
+# during startup and be created if missing.
+#
+# Every line must either be a comment starting with #
+# or a definition of format:
+# <type> <owner> <group> <mode> <path> <linksource>
+# where the items are separated by whitespace !
+#
+# <type> : d|f|l : (d)irectory|(f)ile|(l)ink
+#
+# A linking example:
+# l root root 0777 /var/test /tmp/testfile
+# f root root 0644 /var/test none
+#
+# Understanding links:
+# When populate-volatile is to verify/create a directory or file, it will first
+# check it's existence. If a link is found to exist in the place of the target,
+# the path of the target is replaced with the target the link points to.
+# Thus, if a link is in the place to be verified, the object will be created
+# in the place the link points to instead.
+# This explains the order of "link before object" as in the example above, where
+# a link will be created at /var/test pointing to /tmp/testfile and due to this
+# link the file defined as /var/test will actually be created as /tmp/testfile.
+d root root 0755 /var/volatile/cache none
+d root root 1777 /var/volatile/lock none
+d root root 0755 /var/volatile/log none
+d root root 0755 /var/volatile/run none
+d root root 1777 /var/volatile/tmp none
+l root root 0755 /var/cache /var/volatile/cache
+l root root 1777 /var/lock /var/volatile/lock
+l root root 0755 /var/log /var/volatile/log
+l root root 0755 /var/run /var/volatile/run
+l root root 1777 /var/tmp /var/volatile/tmp
+d root root 0755 /var/lock/subsys none
+f root root 0664 /var/log/wtmp none
+f root root 0644 /var/log/lastlog none
+f root root 0664 /var/run/utmp none
+l root root 0644 /etc/resolv.conf /var/run/resolv.conf
+f root root 0644 /var/run/resolv.conf none
+