-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcheckrestart.1
134 lines (134 loc) · 3.52 KB
/
checkrestart.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
.Dd February 21, 2020
.Dt CHECKRESTART 1
.Os
.Sh NAME
.Nm checkrestart
.Nd check for processes that may need restarting
.Sh SYNOPSIS
.Nm
.Op Fl -libxo
.Op Fl bHw
.Op Fl j Ar jail
.Op Fl u Ar user
.Op Ar proc ...
.Sh DESCRIPTION
The
.Nm
command attempts to find processes that need restarting following a software
upgrade, as indicated by their underlying executable or shared libraries no
longer appearing on disk.
.Pp
.Nm
does not perform any system changes itself \(em it is strictly informational and
best-effort (See the
.Sx BUGS
section).
It is the responsibility of the system administrator to interpret the results
and take any necessary action.
.Pp
For full system-wide checks,
.Nm
should be executed as the superuser to allow it access to global virtual memory
mappings.
.Pp
The following options are available:
.Bl -tag -width indent
.It Fl -libxo
Generate formatted output via
.Xr libxo 3
in a selection of human and machine-readable formats.
See
.Xr xo_parse_args 3
for details on available arguments.
.It Fl b
Check only for missing binaries, skipping the far more expensive check for stale
libraries.
.It Fl H
Suppress the header.
.It Fl w
Print the full width of the ARGUMENTS column even if it will wrap in the terminal.
.It Fl j Ar jail
Filter output by specified jail name or ID.
.It Fl u Ar user
Filter output by specified user name or ID.
.El
.Pp
If any
.Ar proc
operands are specified, they are treated as process names, IDs, and group IDs to
limit checks to.
.Sh EXAMPLES
Check all processes visible by the user:
.Bd -literal -offset indent
# checkrestart
PID JID USER COMMAND WHY ARGUMENTS
44960 0 freaky weechat .so /usr/local/bin/weechat
81345 0 freaky tmux bin tmux: server (/tmp/tmux-1001/default)
80307 0 freaky tmux bin tmux: client (/tmp/tmux-1001/default)
18115 1 nobody memcached bin /usr/local/bin/memcached
.Ed
.Pp
This output indicates
.Nm weechat
is using an out of date library, a
.Nm tmux
client/server pair is using an out-of-date executable, having replaced its
arguments list obscuring its location, and
.Nm memcached ,
running in jail 1, is also out of date having left its arguments list as the
full path to its original executable.
.Pp
Check only processes named weechat and tmux:
.Bd -literal -offset indent
# checkrestart weechat tmux
.Ed
.Pp
Check only processes with PID 142 and 157:
.Bd -literal -offset indent
# checkrestart 142 157
.Ed
.Pp
Check only processes in PGID 117:
.Bd -literal -offset indent
# checkrestart -- -117
.Ed
.Sh SEE ALSO
.Xr procstat 1 ,
.Xr libxo 3 ,
.Xr xo_parse_args 3 ,
.Xr jail 8 ,
.Xr service 8
.Sh HISTORY
A
.Nm
command first appeared in the debian-extras package in Debian Linux.
.Pp
This implementation follows a similar idea, and is based on a prior version
in the author's
.Nm pkg-cruft
Ruby script.
.Pp
A similar tool is also available in
.Fx
ports as sysutils/lsop.
.Pp
An unrelated but similar
.Nm
command is also available as an
.Ox
port.
.Sh AUTHORS
.An Thomas Hurst Aq tom@hur.st
.Sh BUGS
.Nm
may report both false positives and false negatives, depending on program and
kernel behaviour, and should be considered strictly "best-effort".
.Pp
In particular, retrieval of pathnames is implemented using the kernel's name
cache \(em if an executable or library path is not in the name cache due to
an eviction, or use of a file system which does not use the name cache,
.Nm
will consider this the same as if a file is missing.
.Pp
The use of the name cache also means it is not yet possible to report which
files are considered missing.