Codebase list debian-goodies / ad3801c
Change output format to match Tollef Fog Heen's proposal as this is easier to parse than tabs Javier Fernandez-Sanguino 6 years ago
2 changed file(s) with 24 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
189189 diverted = None
190190
191191 dpkgQuery = ["dpkg-query", "--search"] + list(programs.keys())
192 if verbose and not machineOutput:
192 if verbose:
193193 print("[DEBUG] Running: %s" % ' '.join(dpkgQuery))
194194 dpkgProc = subprocess.Popen(dpkgQuery, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
195195 env = lc_all_c_env)
326326 print("These are the initd scripts:")
327327 print('\n'.join(restartInitCommands))
328328 print()
329 else:
330 for package in restartable:
331 for process in package.processes:
332 print('SERVICE:%s,%s,%s' % (package.name, process.pid,process.program))
329333
330334 if len(nonrestartable) == 0:
331335 sys.exit(0)
340344 print("\t%s\t%s" % (process.pid,process.program))
341345 else:
342346 for process in package.processes:
343 print 'no-init\t%s\t%s\t%s' % (package.name,process.pid,process.program)
347 print('OTHER:%s,%s,%s' % (package.name,process.pid,process.program))
344348
345349
346350 def lsoffilescheck(blacklist = None):
1111 .SH NAME
1212 checkrestart \- check which processes need to be restarted after an upgrade
1313 .SH SYNOPSIS
14 .B checkrestart [ -hvpan ] [ -b blacklist_file ] [ -i package_name ] [ -e pid ]
14 .B checkrestart [ -hvpanm ] [ -b blacklist_file ] [ -i package_name ] [ -e pid ]
1515 .SH DESCRIPTION
1616 The
1717 .B checkrestart
6161 simultaneously with the
6262 .B -p
6363 option.
64
65 .TP
66 \fB-m\fP, \fB\-\-machine\fP
67 Generate machine readable output. One line is printed per program which must be
68 restarted: "TYPE:package_name,pid,program". Where TYPE is
69 .B INIT
70 , if a systemd service file or an init script is available to restart the program, and
71 .B OTHER
72 otherwise.
6473
6574 .TP
6675 \fB\-b\fP \fIfile\fP, \fB\-\-blacklist=\fP\fIfile\fP
157166 isc-dhcp-client:
158167 3775 /sbin/dhclient
159168
169 This is another example to show the machine-readable output:
170
171 # checkrestart --machine
172 init bcfg2-server 6974 /usr/sbin/bcfg2-server
173 init exim4-daemon-light 857 /usr/sbin/exim4
174 no-init aptitude 11679 /usr/bin/aptitude-curses
175 no-init xscreensaver 6562 /usr/bin/xscreensaver
176
160177 .SH BUGS
161178 This program might fail if the output of the \fBlsof(8)\fP utility changes since it
162179 depends on it to detect which deleted files are used by processes. It might