Debian Codegraph @

upstream/debian-unstable/man8/dnf5-needs-restarting.8

raw
1 .\" Man page generated from reStructuredText
2 .\" by the Docutils 0.22.4 manpage writer.
3 .
4 .
5 .nr rst2man-indent-level 0
6 .
7 .de1 rstReportMargin
8 \\$1 \\n[an-margin]
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
11 -
12 \\n[rst2man-indent0]
13 \\n[rst2man-indent1]
14 \\n[rst2man-indent2]
15 ..
16 .de1 INDENT
17 .\" .rstReportMargin pre:
18 . RS \\$1
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
22 ..
23 .de UNINDENT
24 . RE
25 .\" indent \\n[an-margin]
26 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27 .nr rst2man-indent-level -1
28 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30 ..
31 .TH "DNF5-NEEDS-RESTARTING" "8" "May 09, 2026" "" "dnf5"
32 .SH NAME
33 dnf5-needs-restarting \- Needs-restarting Command
34 .SH SYNOPSIS
35 .sp
36 \fBdnf5 needs\-restarting [\-p | \-\-processes [\-e | \-\-exclude\-services]] [\-s | \-\-services] [\-r | \-\-reboothint] [\-\-json]\fP
37 .SH DESCRIPTION
38 .sp
39 The \fBneeds\-restarting\fP command determines whether the system should be rebooted to fully apply changes from package installations and upgrades. Without any options, \fBdnf5 needs\-restarting\fP will report whether any important packages were installed or upgraded since boot. This set of important packages includes the kernel, systemd, each package listed here: \%<https://\:access\:.redhat\:.com/\:solutions/\:27943>, and any package marked with a \fBreboot_suggested\fP advisory.
40 .sp
41 The \fBneeds\-restarting\fP command will exit with code 1 if a reboot is recommended, or, when invoked with \fB\-\-services\fP, if any systemd service needs restarting. If no action is recommended, \fBneeds\-restarting\fP will exit with code 0.
42 .SH OPTIONS
43 .INDENT 0.0
44 .TP
45 .B \fB\-p, \-\-processes\fP
46 .nf
47 List processes that need restarting. If the package that provides the executable running, or any of its dependencies, have been updated since the process started, then restarting the process will be recommended.
48 .fi
49 .sp
50 .TP
51 .B \fB\-e, \-\-exclude\-services\fP
52 .nf
53 Used with the \fB\-p, \-\-processes\fP option and will filter out any processes that are handled by systemd services.
54 .fi
55 .sp
56 .TP
57 .B \fB\-s, \-\-services\fP
58 .nf
59 List systemd services that need restarting. If the package that provides the service, or any of its dependencies, have been updated since the service started, then restarting the service will be recommended. Note that this approach is quite aggressive to recommend a restart when one may not be strictly necessary.
60 .fi
61 .sp
62 .TP
63 .B \fB\-r, \-\-reboothint\fP
64 .nf
65 Has no effect, kept for compatibility with DNF 4. \(dqdnf4 needs\-restarting \-r\(dq provides the same functionality as \(dqdnf5 needs\-restarting\(dq.
66 .fi
67 .sp
68 .TP
69 .B \fB\-\-json\fP
70 .nf
71 Request JSON output format for machine\-readable results.
72 .fi
73 .sp
74 .UNINDENT
75 .SH JSON OUTPUT
76 .INDENT 0.0
77 .IP \(bu 2
78 \fBdnf5 needs\-restarting \-\-json\fP
79 .UNINDENT
80 .sp
81 The command returns a JSON array containing a single object with the reboot hint information. The object contains the following fields:
82 .INDENT 0.0
83 .INDENT 3.5
84 .INDENT 0.0
85 .IP \(bu 2
86 \fBtype\fP (string) \- Type of output, always \(dqreboot\(dq.
87 .IP \(bu 2
88 \fBreboot_required\fP (boolean) \- Whether a reboot is required.
89 .IP \(bu 2
90 \fBpackages\fP (array of strings) \- List of packages that were updated since boot\-up.
91 .IP \(bu 2
92 \fBdocumentation\fP (string) \- Link to documentation explaining the reboot requirement.
93 .UNINDENT
94 .UNINDENT
95 .UNINDENT
96 .INDENT 0.0
97 .IP \(bu 2
98 \fBdnf5 needs\-restarting \-\-services \-\-json\fP
99 .UNINDENT
100 .sp
101 The command returns a JSON array of objects, each describing a systemd service that needs restarting. Each object contains the following fields:
102 .INDENT 0.0
103 .INDENT 3.5
104 .INDENT 0.0
105 .IP \(bu 2
106 \fBtype\fP (string) \- Type of output, always \(dqunit\(dq.
107 .IP \(bu 2
108 \fBunit\fP (string) \- Name of the systemd service.
109 .UNINDENT
110 .UNINDENT
111 .UNINDENT
112 .INDENT 0.0
113 .IP \(bu 2
114 \fBdnf5 needs\-restarting \-\-processes \-\-json\fP
115 .UNINDENT
116 .sp
117 The command returns a JSON array of objects, each describing a running process that needs restarting. Each object contains the following fields:
118 .INDENT 0.0
119 .INDENT 3.5
120 .INDENT 0.0
121 .IP \(bu 2
122 \fBtype\fP (string) \- Type of output, always \(dqprocess\(dq.
123 .IP \(bu 2
124 \fBpid\fP (integer) \- Process ID.
125 .IP \(bu 2
126 \fBcmdline\fP (array of strings) \- Command line of the process.
127 .IP \(bu 2
128 \fBpackage\fP (string) \- Package providing the executable.
129 .UNINDENT
130 .UNINDENT
131 .UNINDENT
132 .sp
133 The \fB\-\-json\fP option can be combined with \fB\-\-exclude\-services\fP when using \fB\-\-processes\fP to filter out processes managed by systemd services (e.g. \fBdnf5 needs\-restarting \-\-processes \-\-exclude\-services \-\-json\fP).
134 .sp
135 For empty results for services or processes, the commands return \fB[]\fP\&. For reboot hints, even if no reboot is recommended, the command returns a JSON array containing a single object with \fBreboot_required\fP set to false, an empty array of \fBpackages\fP, and the \fBdocumentation\fP link.
136 .SH Author
137 See AUTHORS.md in dnf5 source distribution.
138 .SH Copyright
139 Contributors to the dnf5 project.
140 .\" End of generated man page.