Annotation of /trunk/magellan-initscripts/rc/mountfs
Parent Directory | Revision Log
Revision 3 -
(hide annotations)
(download)
Mon Dec 13 22:52:07 2004 UTC (19 years, 9 months ago) by niro
Original Path: trunk/magellan-initscripts/etc/rc.d/init.d/mountfs
File size: 1987 byte(s)
Mon Dec 13 22:52:07 2004 UTC (19 years, 9 months ago) by niro
Original Path: trunk/magellan-initscripts/etc/rc.d/init.d/mountfs
File size: 1987 byte(s)
This commit was generated by cvs2svn to compensate for changes in r2, which included commits to RCS files with non-trunk default branches.
1 | niro | 2 | #!/bin/bash |
2 | |||
3 | #%rlevels: 7:s 0:k 6:k | ||
4 | #%start: 40 | ||
5 | #%stop: 60 | ||
6 | |||
7 | #deps | ||
8 | #%needs: | ||
9 | #%before: | ||
10 | #%after: | ||
11 | |||
12 | source /etc/sysconfig/rc | ||
13 | source $rc_functions | ||
14 | |||
15 | #$1= filesys | ||
16 | get_mounted(){ | ||
17 | local filesys | ||
18 | filesys=$1 | ||
19 | |||
20 | cat /proc/mounts | grep ${filesys} | cut -d ' ' -f3 | ||
21 | } | ||
22 | |||
23 | case "$1" in | ||
24 | start) | ||
25 | echo -e ${COLOREDSTAR}"Remounting root file system in read-write mode ..." | ||
26 | mount -n -o remount,rw / | ||
27 | evaluate_retval | ||
28 | |||
29 | echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..." | ||
30 | > /etc/mtab | ||
31 | mount -f / && mount -f /proc | ||
32 | # add /dev above if you use devfs | ||
33 | |||
34 | #records devfs if mounted | ||
35 | if [ "$(get_mounted devfs)" == devfs ] | ||
36 | then | ||
37 | mount -f -t devfs none /dev | ||
38 | fi | ||
39 | |||
40 | #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 | |||
52 | #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" | ||
67 | NO_FS="nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm" | ||
68 | echo -e ${COLOREDSTAR}"Mounting remaining file systems ..." | ||
69 | mount -a -t $NO_FS | ||
70 | evaluate_retval | ||
71 | |||
72 | update_svcstatus $1 | ||
73 | splash svc_started "$(basename $0)" 0 | ||
74 | ;; | ||
75 | |||
76 | stop) | ||
77 | echo -e ${COLOREDSTAR}"Unmounting all other currently mounted file systems ..." | ||
78 | if [ -e /dev/.udev ] | ||
79 | then | ||
80 | NO_FS="noramfs" | ||
81 | umount -a -r -d -t ${NO_FS} | ||
82 | else | ||
83 | # -d, umount loop devices as well | ||
84 | umount -a -r -d | ||
85 | fi | ||
86 | evaluate_retval | ||
87 | |||
88 | update_svcstatus $1 | ||
89 | splash svc_stopped "$(basename $0)" 0 | ||
90 | ;; | ||
91 | |||
92 | *) | ||
93 | echo "Usage: $0 {start|stop}" | ||
94 | exit 1 | ||
95 | ;; | ||
96 | esac |
Properties
Name | Value |
---|---|
svn:executable | * |