1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
.\"
.\" fstab-sync manual page.
.\" Copyright (C) 2004 Red Hat, Inc.
.\"
.TH fstab-sync 8
.SH NAME
fstab-sync \- Update the
.B /etc/fstab
file in response to HAL events
.SH SYNOPSIS
.PP
.B fstab-sync
[-cv?] [-a|--add UDI] [-r|--remove UDI] [-c|--clean]
[-v|--verbose] [-?|--help] [--usage]
.SH DESCRIPTION
This program serves one major purpose: Update the file systems table file
.B /etc/fstab
and create/remove mount points in
.B /media
in response to HAL events. This program is usually never run directly
from a shell; instead it is invoked as a callout from the
.B @SYSCONFDIR@/hal/device.d
directory by the HAL daemon.
.PP
Additionally, this program offers an option of removing any trace of
its previous actions from the file systems table file. Specifically
this happens when invoked by the HAL daemon for the root computer
device object which only happens when the HAL daemon is starting
up. Thus, when starting the HAL daemon, the
.B /etc/fstab
file will be completely sanitized, e.g. all entries previously added
by the
.B fstab-sync
program will be removed. When probing for hardware during the
startup of the HAL daemon, the
.B fstab-sync
program will be invoked several times to add new entries to the
.B /etc/fstab
file.
.PP
All entries added to
.B /etc/fstab
by
.B fstab-sync
can be identified by the use of the option
.B managed
in the options field. This option is a no-op; it is only used to uniquely
identify entries added by the
.B fstab-sync
program.
.PP
When the
.B /etc/fstab
file is written by
.B fstab-sync,
a comment with a link to this manual page is added to the file.
.SH CONTROLLING WHAT ENTRIES TO ADD
The
.B fstab-sync
program relies on properties on the relevant HAL device objects in
order to determine if and how an entry to the
.B /etc/fstab
file should be added. Specifically, entries are added for hal device
objects of respectively capability
.B storage
and
.B volume
only if appropriate
.B storage.policy
and
.B volume.policy
properties are set. Also, the
.B storage.policy.default
properties on the root computer device object are taken into account.
See the HAL specification on
.B http://freedesktop.org/Software/hal
for more information.
.PP
By default, the
.B @DATADIR@/hal/fdi/90defaultpolicy/storage-policy.fdi
file specifies the policy - this file should never be edited by the
system administrator as it might get updated by the OS vendor for security
updates. Instead, system- or site-specific rules can be put in
the
.B @DATADIR@/hal/fdi/95userpolicy
directory.
Device information files are processed for every hal device object in the
.B @DATADIR@/hal/fdi/
directory in alphabetical order including directories. Hence, files in the
.B 90defaultpolicy
directory are processed before files
.B 95userpolicy
directory,
.B 95userpolicy/a.fdi
is processed before
.B 95userpolicy/b.fdi
and so on. In addition, directives in specific files are processed in a
top-down fashion.
.PP
A number of sample policy files for various uses should
be available in the
.B @DATADIR@/doc/hal-@VERSION@/conf
directory. For example, the policy file
.B storage-non-fixed.fdi
ensures that only fixed optical and floppy drives gets tagged as
mountable which ensures that e.g. hard disk partitions on a fixed disk
won't get added to the
.B /etc/fstab
file. Similarly the
.B storage-skip-all.fdi
file will ensure no entries are ever added.
.SH DISABLING FSTAB-SYNC
Automatic updates of the
.B /etc/fstab
file by the
.B fstab-sync
program from the HAL daemon can be disabled by changing the
.B 50-fstab-sync.hal
symlink in
.B @SYSCONFDIR@/hal/device.d
directory to point to
.B /bin/false
.
.SH OPTIONS
The following options are supported:
.TP
.I "--add=UDI"
Add an entry to the
.B /etc/fstab
file by giving a HAL Unique Device Identifier
.TP
.I "--remove=UDI"
Remove an entry from fstab by giving a HAL Unique Device Identifier
.TP
.I "--clean"
Clean all entries generated by
.B fstab-sync
from the
.B /etc/fstab
file
.TP
.I "--verbose"
Report detailed information about operation progress
.TP
.I "--usage"
Display brief usage message
.TP
.I "--help"
Show options
.SH LOCKING
The
.B fstab-sync
program uses
.BR flock (2)
for locking the
.B /etc/fstab
file when adding or removing entries. This happens when the HAL daemon
starts up, when there's a media change event or when a storage device
is hotplugged.
.SH SEE ALSO
.BR fstab (5),
.B http://freedesktop.org/Software/hal
.SH BUGS
One known bug is that the HAL daemon has to be running when cleaning
the
.B /etc/fstab
file. Please send bug reports to the appropriate distribution bug
tracker or the HAL mailing list - see
http://freedesktop.org/Software/HalTraces for more information.
|