BSD 3 development
[unix-history] / usr / man / man8 / sticky.8
CommitLineData
e6817382
BJ
1.TH STICKY 8
2.SH NAME
3sticky \- executable files with persistent text
4.SH DESCRIPTION
5While the `sticky bit', mode 01000 (see
6.IR chmod (2)),
7is set on a sharable executable file,
8the text of that file will not be removed from the system swap area.
9Thus the file does not have to be fetched from the file system
10upon each execution.
11As long as a copy remains in the swap area, the
12original text cannot be overwritten in the file system,
13nor can the file be deleted.
14(Directory entries can be removed so long as one link remains.)
15.PP
16Sharable files are made by the
17.B \-n
18and
19.B \-i
20options of
21.IR ld (1).
22.PP
23To 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.
27This can be done safely even if others are using it.
28(3) Overwrite the sticky file.
29If the file is being executed by any process,
30writing will be prevented; see the next paragraph
31for a dodge.
32(4) Set the sticky bit again.
33Only the super-user can set the sticky bit.
34.PP
35To replace a sharable executable file while any user is
36executing 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),
42or otherwise.
43(3) With
44.I chown
45and
46.IR chmod (2),
47set the mode of the new file to agree with that of the original
48as necessary.
49(4) Delete the old file when convenient.
50.SH BUGS
51Are self-evident.