-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlinfreeze.1
137 lines (137 loc) · 3.13 KB
/
linfreeze.1
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
.Dd November 13, 2010
.Os Linux
.Dt LINFREEZE 1
.
.Sh NAME
.Nm LinFreeze
.Nd Utility to prevent permanent file changes across reboots.
.
.Sh SYNOPSYS
.Nm linfreeze
.Op Fl h
.Op Fl v
.Op Fl d Ar directory
.Op Fl f Ar user
.Op Fl u
.Op Fl s Ar user or directory
.Op Fl c
.Op Fl l
.
.Sh OPTIONS
.Fl h
.D1 Display usage information and exit.
.Fl v
.D1 Display version information and exit.
.Fl d Op Ar directory
.D1 So Freeze Sc a directory to prevent permanent changes.
.Fl f Op Ar user
.D1 So Freeze Sc a user account.
.Fl u
.D1 So Unfreeze Sc all accounts and directories.
.Fl s Op Ar user or directory
.D1 So Unfreeze Sc a specific account or directory.
.Fl c
.D1 Removes all temporary directories used for freezing.
.Fl l
.D1 Lists the So frozen Sc users and directories on a system.
.
.Sh DESCRIPTION
.Nm LinFreeze
is a utility to
.Sq freeze
a user's home folder or any directory, meaning that the files and folders within that directory are
.Pq recursively
prevented from being permanently changed. Any changes made to these files and folders are not permanent, and when the system is rebooted the files and folders are returned to their original state.
.Pp
.Nm LinFreeze
can do this by modifying
.Pa /etc/fstab
to lay a tmpfs layer on top of it where all temporary changes are stored and later discarded upon rebooting. The tmpfs layer is always located at /path/to/frozen/directory.dynamic. Optionally, a
.So static Sc
directory may be made where you may put read-only files to be layed above the original directory, but under the dynamic directory. The arguments
.Op Fl d Ar directory
and
.Op Fl f Ar user
can be used to freeze a directory or a user, respectively.
.Pp
When a user or directory is frozen,
.Pa /etc/fstab.thaw
is created as a backup of the old
.Pa /etc/fstab
file. Lines containing the users and directories frozen are appended to the end of
.Pa /etc/fstab.
A list of dynamic directories is included in
.Pa /etc/.frozen
and a list of static directories, if any, is included in
.Pa /etc/.static.
.Pp
The argument
.Op Fl u
is used to un-freeze directories and users by replacing
.Pa /etc/fstab
with
.Pa /etc/fstab.thaw.
After it successfully completes, a message to reboot and use the
.Op Fl c
argument is shown.
.Op Fl c
removes the dynamic and, if applicable, static directories after they have been unloaded from rebooting. The
.Op s
argument, followed by a
.So frozen Sc
user or directory,
.So unfreezes Sc
a specific user or directory that is frozen.
.Pp
Also, the
.Op Fl l
argument can be used to list the users and directories that are
.So frozen Sc
if the list exists.
.
.Sh IMPLEMENTATION NOTES
Dependencies:
.Bl -dash -offset indent -compact
.It
Bash
.It
aufs2
.It
tmpfs
.It
sed
.It
gzip
.It
UNIX-like filesystem structure with
.Pa /etc/fstab
and user directories in
.Pa /home
.
.Sh FILES
List of files that
.Nm LinFreeze
accesses and creates:
.Bl -item
.It
.Pa /etc/fstab
.It
.Pa /etc/fstab.thaw
.It
.Pa /etc/.frozdirs
.It
.Pa /etc/.dynamic
.It
.Pa /etc/.static
.It
.Pa /etc/.spec-dy
.It
.Pa /etc/.spec-stat
.It
.Pa /tmp/.linreboot
.
.Sh AUTHOR
.An Ryan Peters Aq sloshy45 AT sbgclobal DOT net
.
.Sh COPYRIGHT
Copyright 2010 Ryan Peters. Licensed under the GPLv3 or newer.