Annotation of /trunk/magellan-initscripts/rc/mountfs
Parent Directory | Revision Log
Revision 71 -
(hide annotations)
(download)
Tue Mar 15 19:07:56 2005 UTC (19 years, 6 months ago) by niro
Original Path: trunk/magellan-initscripts/etc/rc.d/init.d/mountfs
File size: 2043 byte(s)
Tue Mar 15 19:07:56 2005 UTC (19 years, 6 months ago) by niro
Original Path: trunk/magellan-initscripts/etc/rc.d/init.d/mountfs
File size: 2043 byte(s)
updated header and fixed whitespaces
1 | niro | 2 | #!/bin/bash |
2 | niro | 71 | # $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/mountfs,v 1.3 2005-03-15 19:07:56 niro Exp $ |
3 | niro | 2 | |
4 | #%rlevels: 7:s 0:k 6:k | ||
5 | #%start: 40 | ||
6 | #%stop: 60 | ||
7 | |||
8 | #deps | ||
9 | #%needs: | ||
10 | #%before: | ||
11 | #%after: | ||
12 | |||
13 | source /etc/sysconfig/rc | ||
14 | source $rc_functions | ||
15 | |||
16 | #$1= filesys | ||
17 | get_mounted(){ | ||
18 | local filesys | ||
19 | filesys=$1 | ||
20 | |||
21 | cat /proc/mounts | grep ${filesys} | cut -d ' ' -f3 | ||
22 | } | ||
23 | |||
24 | case "$1" in | ||
25 | start) | ||
26 | echo -e ${COLOREDSTAR}"Remounting root file system in read-write mode ..." | ||
27 | mount -n -o remount,rw / | ||
28 | evaluate_retval | ||
29 | |||
30 | echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..." | ||
31 | > /etc/mtab | ||
32 | mount -f / && mount -f /proc | ||
33 | niro | 71 | |
34 | niro | 2 | #records devfs if mounted |
35 | if [ "$(get_mounted devfs)" == devfs ] | ||
36 | then | ||
37 | mount -f -t devfs none /dev | ||
38 | fi | ||
39 | niro | 71 | |
40 | niro | 2 | #records devpts if mounted |
41 | if [ "$(get_mounted devpts)" == devpts ] | ||
42 | then | ||
43 | mount -f -t devpts none /dev/pts | ||
44 | fi | ||
45 | |||
46 | #records sysfs if mounted | ||
47 | if [ "$(get_mounted sysfs)" == sysfs ] | ||
48 | then | ||
49 | mount -f -t sysfs none /sys | ||
50 | fi | ||
51 | niro | 71 | |
52 | niro | 2 | #records udev's ramfs if mounted |
53 | if [ "$(get_mounted ramfs)" == ramfs ] | ||
54 | then | ||
55 | mount -f -t ramfs none /dev | ||
56 | fi | ||
57 | |||
58 | evaluate_retval | ||
59 | |||
60 | # The following mount command will mount all file systems. If you | ||
61 | # have other (network based) file system that should not be or | ||
62 | # cannot be mounted at this time, add them to the NO_FS variable | ||
63 | # below. All file systems that are added to the variable in the | ||
64 | # form of no<filesystem> will be skipped. | ||
65 | |||
66 | NO_FS="nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm" | ||
67 | echo -e ${COLOREDSTAR}"Mounting remaining file systems ..." | ||
68 | mount -a -t $NO_FS | ||
69 | evaluate_retval | ||
70 | |||
71 | update_svcstatus $1 | ||
72 | splash svc_started "$(basename $0)" 0 | ||
73 | ;; | ||
74 | |||
75 | stop) | ||
76 | echo -e ${COLOREDSTAR}"Unmounting all other currently mounted file systems ..." | ||
77 | if [ -e /dev/.udev ] | ||
78 | then | ||
79 | NO_FS="noramfs" | ||
80 | umount -a -r -d -t ${NO_FS} | ||
81 | else | ||
82 | # -d, umount loop devices as well | ||
83 | umount -a -r -d | ||
84 | fi | ||
85 | evaluate_retval | ||
86 | |||
87 | update_svcstatus $1 | ||
88 | splash svc_stopped "$(basename $0)" 0 | ||
89 | ;; | ||
90 | |||
91 | *) | ||
92 | echo "Usage: $0 {start|stop}" | ||
93 | exit 1 | ||
94 | ;; | ||
95 | esac |
Properties
Name | Value |
---|---|
svn:executable | * |