EasyManuals Logo

Linux Pocket Linux Guide User Manual

Default Icon
67 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #38 background imageLoading...
Page #38 background image
else
echo "Remounting / as read−write."
mount −n −o remount,rw /
echo −n > /etc/mtab
mount −f −o remount,rw /
echo "Mounting local filesystems."
mount −a −t nonfs,smbfs
fi
;;
stop)
echo "Unmounting local filesystems."
umount −a −r
;;
*)
echo "usage: $0 start|stop";
;;
esac
#
# end of local_fs
6.3.6. Create a hostname script
Use a text editor to create the following script and save it as ~/staging/etc/init.d/hostname
#!/bin/sh
#
# hostname − set the system name to the name stored in /etc/hostname
#
PATH=/sbin:/bin ; export PATH
echo "Setting hostname."
if [ −f /etc/hostname ]; then
hostname $(cat /etc/hostname)
else
hostname gnu−linux
fi
#
# end of hostname
6.3.7. Create halt & reboot scripts
Use a text editor to create ~/staging/etc/init.d/halt as shown below.
#!/bin/sh
#
# halt − halt the system
#
PATH=/sbin:/bin ; export PATH
echo "Initiating system halt."
halt
#
# end of /etc/init.d/halt
Create the following script and save it as ~/staging/etc/init.d/reboot
Pocket Linux Guide
Chapter 6. Automating Startup & Shutdown 32

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Linux Pocket Linux Guide and is the answer not in the manual?

Linux Pocket Linux Guide Specifications

General IconGeneral
BrandLinux
ModelPocket Linux Guide
CategorySoftware
LanguageEnglish