Commit | Line | Data |
---|---|---|
e6817382 BJ |
1 | .TH STICKY 8 |
2 | .SH NAME | |
3 | sticky \- executable files with persistent text | |
4 | .SH DESCRIPTION | |
5 | While the `sticky bit', mode 01000 (see | |
6 | .IR chmod (2)), | |
7 | is set on a sharable executable file, | |
8 | the text of that file will not be removed from the system swap area. | |
9 | Thus the file does not have to be fetched from the file system | |
10 | upon each execution. | |
11 | As long as a copy remains in the swap area, the | |
12 | original text cannot be overwritten in the file system, | |
13 | nor can the file be deleted. | |
14 | (Directory entries can be removed so long as one link remains.) | |
15 | .PP | |
16 | Sharable files are made by the | |
17 | .B \-n | |
18 | and | |
19 | .B \-i | |
20 | options of | |
21 | .IR ld (1). | |
22 | .PP | |
23 | To replace a sticky file that has been used do: | |
24 | (1) Clear the sticky bit with | |
25 | .IR chmod (1). | |
26 | (2) Execute the old program to flush the swapped copy. | |
27 | This can be done safely even if others are using it. | |
28 | (3) Overwrite the sticky file. | |
29 | If the file is being executed by any process, | |
30 | writing will be prevented; see the next paragraph | |
31 | for a dodge. | |
32 | (4) Set the sticky bit again. | |
33 | Only the super-user can set the sticky bit. | |
34 | .PP | |
35 | To replace a sharable executable file while any user is | |
36 | executing it do: | |
37 | (1) Rename the directory entry for that file with | |
38 | .IR mv (1). | |
39 | (2) Install the new program with | |
40 | .I cp, | |
41 | .IR mv (1), | |
42 | or otherwise. | |
43 | (3) With | |
44 | .I chown | |
45 | and | |
46 | .IR chmod (2), | |
47 | set the mode of the new file to agree with that of the original | |
48 | as necessary. | |
49 | (4) Delete the old file when convenient. | |
50 | .SH BUGS | |
51 | Are self-evident. |