[Initng-svn] r1992 - initng/initfiles/system
svn at initng.thinktux.net
svn at initng.thinktux.net
Tue Nov 8 01:16:31 CET 2005
Author: jimmy
Date: Tue Nov 8 01:16:30 2005
New Revision: 1992
Modified:
initng/initfiles/system/mountfs.ii
initng/initfiles/system/mountroot.ii
initng/initfiles/system/netmount.ii
initng/initfiles/system/ntpdate.ii
initng/initfiles/system/numlock.ii
Log:
Some more.
Modified: initng/initfiles/system/mountfs.ii
==============================================================================
--- initng/initfiles/system/mountfs.ii (original)
+++ initng/initfiles/system/mountfs.ii Tue Nov 8 01:16:30 2005
@@ -1,53 +1,52 @@
service system/mountfs {
- need = system/initial system/mountroot
+ need = system/initial system/@mount at root
use = system/sraid system/hdparm
# system/modules
critical
start {
- export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
retval=0
#Check all filesystems
if [ -f /fastboot ]; then
- rm -f /fastboot
+ @rm@ -f /fastboot
else
if [ -f /forcefsck ] ; then
- echo "A full fsck has been forced"
- /sbin/fsck -C -R -A -a -f
+ @echo@ "A full fsck has been forced"
+ @/sbin/fsck@ -C -R -A -a -f
retval=$?
- rm -f /forcefsck
+ @rm@ -f /forcefsck
else
- /sbin/fsck -C -T -R -A -a
+ @/sbin/fsck@ -C -T -R -A -a
retval=$?
fi
if [ ${retval} -eq 0 ] ; then
- echo -e "\nAll filesystems passed fsck, now mounting .."
+ @echo@ -e "\nAll filesystems passed fsck, now @mount at ing .."
elif [ ${retval} -eq 8 ] ; then
- echo -e "\nFilesystem already mounted, skipping fsck."
+ @echo@ -e "\nFilesystem already @mount at ed, skipping fsck."
elif [ ${retval} -ge 1 ] && [ ${retval} -le 3 ] ; then
- echo -e "\nFilesystem errors corrected by fsck."
+ @echo@ -e "\nFilesystem errors corrected by fsck."
# Everything should be ok, so return a pass
else
- echo "\nFsck could not correct all errors, manual repair needed"
+ @echo@ "\nFsck could not correct all errors, manual repair needed"
# exit 1, with critical set, will shutdown initng, and execute sulogin.
exit 1
fi
fi
- # Mount local filesystems in /etc/fstab.
- mount -aFt reiserfs,reiser4,ext2,ext3,xfs,jfs,vfat,ntfs,tmpfs,bind
+ # @mount@ local filesystems in /etc/fstab.
+ @mount@ -aFt reiserfs,reiser4,ext2,ext3,xfs,jfs,vfat,ntfs,tmpfs,bind
if [ ${?} -ne 0 ]; then
- echo "Mounting failed, trying mount local filesystems again ..."
- if ! mount -at reiserfs,reiser4,ext2,ext3,xfs,jfs,vfat,ntfs,tmpfs,bind,subfs; then
- echo "WARNING, failed to mount some local filesystems"
+ @echo@ "@mount at ing failed, trying @mount@ local filesystems again ..."
+ if ! @mount@ -at reiserfs,reiser4,ext2,ext3,xfs,jfs,vfat,ntfs,tmpfs,bind,subfs; then
+ @echo@ "WARNING, failed to @mount@ some local filesystems"
#this is not critical, lets continue anyway.
fi
fi
- # Mount all type bind.
- mount -at bind
+ # @mount@ all type bind.
+ @mount@ -at bind
# Always return happily, or sulogin will be executed.
exit 0
Modified: initng/initfiles/system/mountroot.ii
==============================================================================
--- initng/initfiles/system/mountroot.ii (original)
+++ initng/initfiles/system/mountroot.ii Tue Nov 8 01:16:30 2005
@@ -2,47 +2,45 @@
need = system/initial
critical
start {
-
- export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
retval=0
# startDM
- if [ -f /sbin/dmsetup ]; then
- /sbin/dmsetup mknodes >/dev/null 2>&1
+ if [ -f @/sbin/dmsetup@ ]; then
+ @/sbin/dmsetup@ mknodes >/dev/null 2>&1
fi
#startLVM
- if [ -f `which vgchange 2> /dev/null` ]; then
+ if [ -f @vgchange@ ]; then
# try to load module in case that hasn't been done yet
- modprobe lvm >/dev/null 2>&1
- modprobe lvm-mod >/dev/null 2>&1
- modprobe dm-mod >/dev/null 2>&1
- mknod --mode=600 /dev/lvm c 109 0 >/dev/null 2>&1 || true
+ @modprobe@ lvm >/dev/null 2>&1
+ @modprobe@ lvm-mod >/dev/null 2>&1
+ @modprobe@ dm-mod >/dev/null 2>&1
+ @mknod@ --mode=600 /dev/lvm c 109 0 >/dev/null 2>&1 || true
dm_dir="/dev/mapper"
dm_file="$dm_dir/control"
if [ ! -f /dev/.devfsd ]; then
- major=$(grep "[0-9] misc$" /proc/devices | sed 's/[ ]\+misc//')
- minor=$(grep "[0-9] device-mapper$" /proc/misc | sed 's/[ ]\+device-mapper//')
- test -d $dm_dir || mkdir --mode=755 $dm_dir >/dev/null 2>&1
- test -c $dm_file -o -z "$major" -o -z "$minor" || mknod --mode=600 $dm_file c $major $minor >/dev/null 2>&1
+ major=$(@grep@ "[0-9] misc$" /proc/devices | sed 's/[ ]\+misc//')
+ minor=$(@grep@ "[0-9] device-mapper$" /proc/misc | sed 's/[ ]\+device-mapper//')
+ test -d $dm_dir || @mkdir@ --mode=755 $dm_dir >/dev/null 2>&1
+ test -c $dm_file -o -z "$major" -o -z "$minor" || @mknod@ --mode=600 $dm_file c $major $minor >/dev/null 2>&1
fi
- `which vgscan` --ignorelockingfailure --mknodes >/dev/null 2>&1
- `which vgchange` --ignorelockingfailure -a y >/dev/null 2>&1
+ @vgscan@ --ignorelockingfailure --mknodes >/dev/null 2>&1
+ @vgchange@ --ignorelockingfailure -a y >/dev/null 2>&1
fi
# startEVMS
- if [ -f /sbin/evms_activate ]; then
- evms_activate >/dev/null 2>&1
+ if [ -f @/sbin/evms_activate@ ]; then
+ @/sbin/evms_activate@ >/dev/null 2>&1
fi
# checkROOT
if [ ! -f /fastboot ] ; then
- echo "Remounting root filesystem read-only (if necessary) ..."
- mount -n -o remount,ro / >/dev/null 2>&1
+ @echo@ "Remounting root filesystem read-only (if necessary) ..."
+ @mount@ -n -o remount,ro / >/dev/null 2>&1
if [ -f /forcefsck ] ; then
- echo "Checking root filesystem (full fsck forced)"
- /sbin/fsck -C -a -f /
+ @echo@ "Checking root filesystem (full fsck forced)"
+ @/sbin/fsck@ -C -a -f /
# /forcefsck isn't deleted because system/mountfs need it.
# it'll be deleted in that script.
retval=$?
@@ -52,47 +50,47 @@
# - find the / entry
# - make sure we have 6 fields
# - see if fs_passno is something other than 0
- ROOTLINE=$(cat /etc/fstab | while read fs mountpoint typ options dump pass junk ; do if [ "${fs}" = "/*" ]; then if [ "${mountpoint}" == "/" ] ; then if [ "${pass}" != "0" ] ; then echo ${fs} ${mountpoint} ${typ} ${options} ${dump} ${pass} ; fi ; fi; fi done) # */
+ ROOTLINE=$(cat /etc/fstab | while read fs mountpoint typ options dump pass junk ; do if [ "${fs}" = "/*" ]; then if [ "${mountpoint}" == "/" ] ; then if [ "${pass}" != "0" ] ; then @echo@ ${fs} ${mountpoint} ${typ} ${options} ${dump} ${pass} ; fi ; fi; fi done) # */
if [ -n "$ROOTLINE" ]; then
- echo "Checking root filesystem ..."
- /sbin/fsck -C -T -a /
+ @echo@ "Checking root filesystem ..."
+ @/sbin/fsck@ -C -T -a /
retval=$?
else
- echo "Skipping root filesystem check (fstab's passno == 0) ..."
+ @echo@ "Skipping root filesystem check (fstab's passno == 0) ..."
retval=0
fi
fi
if [ "${retval}" -eq 0 ] ; then
- echo "Filesystem check on / succeeded, now mounting ..."
+ @echo@ "Filesystem check on / succeeded, now mounting ..."
elif [ "${retval}" -eq 1 ] ; then
- echo "Filesystem repaired, now mounting ..."
+ @echo@ "Filesystem repaired, now mounting ..."
elif [ "${retval}" -eq 2 ] || [ "${retval}" -eq 3 ] ; then
- echo "Filesystem repaired, but reboot needed!"
- echo -ne "\a"; sleep 1; echo -ne "\a"; sleep 1
- echo -ne "\a"; sleep 1; echo -ne "\a"; sleep 1
- echo "Rebooting in 2 seconds ..."
- sleep 2
- echo "Rebooting"
- /sbin/ngc -j reboot
+ @echo@ "Filesystem repaired, but reboot needed!"
+ @echo@ -ne "\a"; sleep 1; @echo@ -ne "\a"; sleep 1
+ @echo@ -ne "\a"; sleep 1; @echo@ -ne "\a"; sleep 1
+ @echo@ "Rebooting in 2 seconds ..."
+ @sleep@ 2
+ @echo@ "Rebooting"
+ @/sbin/ngc@ -j reboot
else
- echo "Filesystem couldn't be fixed :("
+ @echo@ "Filesystem couldn't be fixed :("
#exit 1, with critical set, will shut down initng, and execute sulogin.
exit 1
fi
fi
- echo "Should mount / now."
+ @echo@ "Should mount / now."
# Should we mount root rw ?
- if mount -vf -o remount / | grep "\(.*rw.*\)" 2>&1 >/dev/null
+ if @mount@ -vf -o remount / | @grep@ "\(.*rw.*\)" 2>&1 >/dev/null
then
- echo "Remounting root filesystem read/write"
- mount -n -o remount,rw / >/dev/null 2>&1
+ @echo@ "Remounting root filesystem read/write"
+ @mount@ -n -o remount,rw / >/dev/null 2>&1
if [ "$?" -ne 0 ]
then
- echo "Root filesystem could not be mounted read/write :("
+ @echo@ "Root filesystem could not be mounted read/write :("
exit 1
fi
fi
@@ -101,9 +99,9 @@
# Create /etc/mtab
#
# Don't create mtab if /etc is readonly
- if ! touch /etc/mtab 2>/dev/null
+ if ! @touch@ /etc/mtab 2>/dev/null
then
- echo "Skipping /etc/mtab initialization (ro root?)"
+ @echo@ "Skipping /etc/mtab initialization (ro root?)"
exit 0
fi
@@ -111,24 +109,24 @@
>/etc/mtab
# Add the entry for / to mtab
- mount -f /
+ @mount@ -f /
# Don't list root more than once
- grep -v " / " /proc/mounts >>/etc/mtab
+ @grep@ -v " / " /proc/mounts >>/etc/mtab
# Now make sure /etc/mtab have additional info (gid, etc) in there
- cat /proc/mounts | while read pm_fs pm_mountpoint pm_junk ; do
- cat /etc/fstab | while read ef_fs ef_mountpoint ef_junk ; do
+ @cat@ /proc/mounts | while read pm_fs pm_mountpoint pm_junk ; do
+ @cat@ /etc/fstab | while read ef_fs ef_mountpoint ef_junk ; do
if [ "${pm_mountpoint}" = "${ef_mountpoint}" ] ; then
- echo "Mounting ${pm_mountpoint} rw ..."
- mount -f -o remount "${pm_mountpoint}"
+ @echo@ "Mounting ${pm_mountpoint} rw ..."
+ @mount@ -f -o remount "${pm_mountpoint}"
continue
fi
done
done
# Remove stale backups
- rm -f /etc/mtab~ /etc/mtab~~ &> /dev/null
+ @rm@ -f /etc/mtab~ /etc/mtab~~ &> /dev/null
# Return Happily., or sulogin will be executed.
exit 0
}
Modified: initng/initfiles/system/netmount.ii
==============================================================================
--- initng/initfiles/system/netmount.ii (original)
+++ initng/initfiles/system/netmount.ii Tue Nov 8 01:16:30 2005
@@ -5,11 +5,11 @@
start {
# Mount local filesystems in /etc/fstab.
-echo "Mounting network filesystems ..."
-mount -aFt afs,cifs,coda,ncpfs,nfs,nfs4,smbfs
+ at echo@ "Mounting network filesystems ..."
+ at mount@ -aFt afs,cifs,coda,ncpfs,nfs,nfs4,smbfs
if [ "${?}" -ne 0 ]; then
- echo "Mounting failed, trying to mount network filesystems again ..."
- mount -at afs,cifs,coda,ncpfs,nfs,nfs4,smbfs
+ @echo@ "Mounting failed, trying to mount network filesystems again ..."
+ @mount@ -at afs,cifs,coda,ncpfs,nfs,nfs4,smbfs
exit $?
fi
exit 0
@@ -18,11 +18,11 @@
stop {
# Mount local filesystems in /etc/fstab.
-echo "Unmounting network filesystems ..."
-umount -at afs,cifs,coda,ncpfs,nfs,nfs4,smbfs
+ at echo@ "Unmounting network filesystems ..."
+ at umount@ -at afs,cifs,coda,ncpfs,nfs,nfs4,smbfs
if [ "${?}" -ne 0 ]; then
- echo "Unmounting failed, trying to unmount network filesystems again ..."
- umount -aft afs,cifs,coda,ncpfs,nfs,nfs4,smbfs
+ @echo@ "Unmounting failed, trying to unmount network filesystems again ..."
+ @umount@ -aft afs,cifs,coda,ncpfs,nfs,nfs4,smbfs
exit $?
fi
exit 0
Modified: initng/initfiles/system/ntpdate.ii
==============================================================================
--- initng/initfiles/system/ntpdate.ii (original)
+++ initng/initfiles/system/ntpdate.ii Tue Nov 8 01:16:30 2005
@@ -8,8 +8,8 @@
NTPSERVERS="pool.ntp.org"
fi
- echo -n "Running ntpdate to synchronize clock"
- /usr/sbin/ntpdate -b -s $NTPOPTIONS $NTPSERVERS
- echo "."
+ @echo@ -n "Running ntpdate to synchronize clock"
+ @/usr/sbin/ntpdate@ -b -s $NTPOPTIONS $NTPSERVERS
+ @echo@ "."
}
}
Modified: initng/initfiles/system/numlock.ii
==============================================================================
--- initng/initfiles/system/numlock.ii (original)
+++ initng/initfiles/system/numlock.ii Tue Nov 8 01:16:30 2005
@@ -4,23 +4,23 @@
need = system/initial system/mountfs
start {
- echo "Enabling numlock on ttys ..."
+ @echo@ "Enabling numlock on ttys ..."
[[ -d /dev/vc ]] \
&& dev=/dev/vc/ \
|| dev=/dev/tty
for tty in $(seq 1 12) ; do
- setleds -D +num < ${dev}${tty} &> /dev/null
+ @setleds@ -D +num < ${dev}${tty} &> /dev/null
done
exit 0
}
stop {
- echo "Disabling numlock on ttys"
+ @echo@ "Disabling numlock on ttys"
[[ -d /dev/vc ]] \
&& dev=/dev/vc/ \
|| dev=/dev/tty
for tty in $(seq 1 12) ; do
- setleds -D -num < ${dev}${tty} &> /dev/null
+ @setleds@ -D -num < ${dev}${tty} &> /dev/null
done
exit 0
}
More information about the Initng-svn
mailing list