line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Eixo::Zone::FS::Ctl; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1355
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
62
|
|
4
|
2
|
|
|
2
|
|
650
|
use parent qw(Eixo::Zone::Ctl); |
|
2
|
|
|
|
|
279
|
|
|
2
|
|
|
|
|
11
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my $MOUNT_CMD; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my $UMOUNT_CMD; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $MOUNTED_REG = qr/^(\w+)\s+on([^\s]+)\s+type\s+(\w+)\s+\(([^\)]+)\)/; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
BEGIN{ |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
17370
|
$MOUNT_CMD = `env which mount`; chomp($MOUNT_CMD); |
|
2
|
|
|
|
|
48
|
|
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
18234
|
$UMOUNT_CMD = `env which umount`; chomp($UMOUNT_CMD); |
|
2
|
|
|
|
|
1295
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# |
21
|
|
|
|
|
|
|
# tmpfs |
22
|
|
|
|
|
|
|
# |
23
|
|
|
|
|
|
|
sub tmpfsCreate{ |
24
|
0
|
|
|
0
|
0
|
|
my ($self, %data) = @_; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
0
|
|
|
|
my $size = $data{size} || '512m'; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $path = $data{path}; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
$self->__mountTmpfs($size, $path); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub procfsCreateAndMount{ |
34
|
0
|
|
|
0
|
0
|
|
my ($self, %data) = @_; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
$self->__mountProcfs(); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# |
41
|
|
|
|
|
|
|
# mount |
42
|
|
|
|
|
|
|
# |
43
|
|
|
|
|
|
|
sub mount{ |
44
|
0
|
|
|
0
|
0
|
|
my ($self, %data) = @_; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub __umount{ |
49
|
0
|
|
|
0
|
|
|
my ($self, $device) = @_; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
$self->runSysWait( |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$UMOUNT_CMD, |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$device |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub __mounted{ |
60
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
map { |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
$_ =~ /$MOUNTED_REG/; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
{ |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
device=>$1, |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
path => $2, |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
type=>$3, |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
params=>$4 |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
} grep { |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
$_ =~ $MOUNTED_REG |
|
0
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
} split( |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
/\n/, |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
$self->runSysWaitEcho( |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$MOUNT_CMD |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
) |
90
|
|
|
|
|
|
|
); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub __mountTmpfs{ |
94
|
0
|
|
|
0
|
|
|
my ($self, $size, $path) = @_; |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
|
$self->runSysWait( |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
$MOUNT_CMD, |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
'-t', |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
'tmpfs', |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
'-o', |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
"size=$size", |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
"tmpfs", |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
$path |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
); |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub __mountProcfs{ |
116
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
$self->runSysWait( |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
$MOUNT_CMD, |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
'-t', |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
'proc', |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
'proc', |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
'/proc' |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
); |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub __mountBind{ |
136
|
0
|
|
|
0
|
|
|
my ($self, $old, $new) = @_; |
137
|
|
|
|
|
|
|
|
138
|
0
|
|
|
|
|
|
$self->runSysWait( |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
$MOUNT_CMD, |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
'-B', |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
$old, |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
$new |
147
|
|
|
|
|
|
|
); |
148
|
|
|
|
|
|
|
} |