9. /etc/rc.d/init.d/checkfs

D.9. /etc/rc.d/init.d/checkfs

#!/bin/sh ######################################################################## # Begin $rc_base/init.d/checkfs # # Description : File System Check # # Authors : Gerard Beekmans - gerard@linuxfromscratch.org # A. Luebke - luebke@users.sourceforge.net # # Version : 00.00 # # Notes : # # Based on checkfs script from LFS-3.1 and earlier. # # From man fsck # 0 - No errors # 1 - File system errors corrected # 2 - System should be rebooted # 4 - File system errors left uncorrected # 8 - Operational error # 16 - Usage or syntax error # 32 - Fsck canceled by user request # 128 - Shared library error # #########################################################################

. /etc/sysconfig/rc . ${rc_functions}

case "${1}" in start) if [ -f /fastboot ]; then boot_mesg -n "/fastboot found, will not perform" ${INFO} boot_mesg " file system checks as requested." echo_ok case "${1}" in start) if [ -f /fastboot ]; then boot_mesg -n "/fastboot found, will not perform" ${INFO} boot_mesg " file system checks as requested." echo_ok

boot_mesg "Mounting root file system in read-only mode..." mount -n -o remount,ro / >/dev/null evaluate_retval

if [ ${?} != 0 ]; then echo_failure boot_mesg -n "FAILURE:\n\nCannot check root" ${FAILURE} boot_mesg -n " filesystem because it could not be mounted" boot_mesg -n " in read-only mode.\n\nAfter you" boot_mesg -n " press Enter, this system will be" boot_mesg -n " halted and powered off." boot_mesg -n "\n\nPress enter to continue..." ${INFO} boot_mesg "" ${NORMAL} read ENTER ${rc_base}/init.d/halt stop

fi if [ -f /forcefsck ]; then

boot_mesg -n "/forcefsck found, forcing file" ${INFO} boot_mesg " system checks as requested." echo_ok options="-f"

else options="" fi

boot_mesg "Checking file systems..." # Note: -a option used to be -p; but this fails e.g. # on fsck.minix fsck ${options} -a -A -C -T error_value=${?}

if [ "${error_value}" = 0 ]; then echo_ok fi

if [ "${error_value}" = 1 ]; then echo_warning boot_mesg -n "WARNING:\n\nFile system errors" ${WARNING} boot_mesg -n " were found and have been corrected." boot_mesg -n " You may want to double-check that" boot_mesg -n " everything was fixed properly." boot_mesg "" ${NORMAL}

fi if [ "${error_value}" = 2 -o "${error_value}" = 3 ]; then

echo_warning boot_mesg -n "WARNING:\n\nFile system errors" ${WARNING} boot_mesg -n " were found and have been been" boot_mesg -n " corrected, but the nature of the" boot_mesg -n " errors require this system to be" boot_mesg -n " rebooted.\n\nAfter you press enter," boot_mesg -n " this system will be rebooted" boot_mesg -n "\n\nPress Enter to continue..." ${INFO} echo_warning boot_mesg -n "WARNING:\n\nFile system errors" ${WARNING} boot_mesg -n " were found and have been been" boot_mesg -n " corrected, but the nature of the" boot_mesg -n " errors require this system to be" boot_mesg -n " rebooted.\n\nAfter you press enter," boot_mesg -n " this system will be rebooted" boot_mesg -n "\n\nPress Enter to continue..." ${INFO}

fi if [ "${error_value}" -gt 3 -a "${error_value}" -lt 16 ]; then

echo_failure boot_mesg -n "FAILURE:\n\nFile system errors" ${FAILURE} boot_mesg -n " were encountered that could not be" boot_mesg -n " fixed automatically. This system" boot_mesg -n " cannot continue to boot and will" boot_mesg -n " therefore be halted until those" boot_mesg -n " errors are fixed manually by a" boot_mesg -n " System Administrator.\n\nAfter you" boot_mesg -n " press Enter, this system will be" boot_mesg -n " halted and powered off." boot_mesg -n "\n\nPress Enter to continue..." ${INFO} boot_mesg "" ${NORMAL} read ENTER

${rc_base}/init.d/halt stop fi

if [ "${error_value}" -ge 16 ]; then echo_failure boot_mesg -n "FAILURE:\n\nUnexpected Failure" ${FAILURE} boot_mesg -n " running fsck. Exited with error" boot_mesg -n " code: ${error_value}." boot_mesg "" ${NORMAL} exit ${error_value}

fi ;;

*) echo "Usage: ${0} {start}" exit 1 ;;

esac # End $rc_base/init.d/checkfs

Dokumen yang terkait

140 PENGARUH RASIO TEPUNG BIJI KECIPIR DENGAN TEPUNG TERIGU TERHADAP BEBERAPA KOMPONEN GIZI DAN ORGANOLEPTIK BOLU KERING [Ratio Effect of Mixed Winged Bean Seed Flour and Wheat Composite Flour For Some Components of The Nutritions and Organoleptic Sponge

0 0 9

120 MUTU ROTI BERBAHAN DASAR MOCAF: “FORMULASI DAN METODE PEMBUATAN ADONAN” [ The Quality Of Bread Made from Modified Cassava Flour: Dough Formulation and Method] I Wayan Sweca Yasa 1) , Zainuri 1) , Mohammad Abbas Zaini 1) dan Taufikul Hadi 1)

0 0 7

KAJIAN MUTU DAN DAYA SIMPAN KEJU MOZZARELLA PROBIOTIK DARI SUSU KERBAU [The Study of Quality and Shelf Life in Probiotical Mozzarella Cheese from Buffalo Milk] Siti Nuzulan Nur 1) , Satrijo Saloko 2) dan Djoko Kisworo 3)

0 0 9

EFEKTIVITAS PERLAKUAN OZON TERHADAP MUTU KANGKUNG KHAS LOMBOK YANG DIBUDIDAYAKAN PADA DUA LOKASI BERBEDA [The Quality of Lombok Swamp Cabbage Cultivated in Two Different Area and Treated with Ozone]

0 0 7

311 PENINGKATAN MUTU DAN DAYA SIMPAN IKAN PINDANG KUNING “PINDANG RUMBUK” DENGAN PERLAKUAN LAMA STERILISASI [The Enhancement of Quality and Shelf Life of Yellow Seasoned Pindang Fish “Pindang Rumbuk” Through Treatment of Sterilization Time]

1 1 13

289 PENGARUH LAMA PEMANASAN TERHADAP VITAMIN C, AKTIVITAS ANTIOKSIDAN DAN SIFAT SENSORIS SIRUP KERSEN ( Muntingia calabura L.) [The Effect of Boiling Time on Vitamin C, Antioxidant Activity and Sensory Properties of Singapore Cherry (Muntingia calabura L.

0 1 9

283 RENDEMEN SELULOSA HASIL EKSTRAKSI BATANG TANAMAN JAGUNG ( Zea mays) MENGGUNAKAN VARIASI LAMA BLANCHING DAN KONSENTRASI NaOH [Yield and Charateristics of Cellulose from Stalks of Corn Plant (Zea mays) Extraction Using Different Blanching Time and Conce

0 0 6

Hacking and PC Security

0 2 14

Simply Easy Learning by tutorialspoint.com

0 0 148

Improve Productivity for SYSMAC PLCs from Ladder Program Development and Unit Setup to Debugging and Maintenance

0 1 18