Skip to content

Commit 12fcd61

Browse files
author
Eric Fried
committed
doc: How to pdb under systemd
Add a section to the systemd doc describing how to use regular pdb in a systemd environment. Change-Id: Ib1f616f407eccc087de1c60624fa74e2555971c2
1 parent 1ad91a7 commit 12fcd61

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

doc/source/systemd.rst

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ Follow logs for a specific service::
9898

9999
Following logs for multiple services simultaneously::
100100

101-
journalctl -f --unit devstack@n-cpu.service --unit
102-
devstack@n-cond.service
101+
journalctl -f --unit devstack@n-cpu.service --unit devstack@n-cond.service
103102

104103
or you can even do wild cards to follow all the nova services::
105104

@@ -121,6 +120,29 @@ left/right arrow keys.
121120

122121
See ``man 1 journalctl`` for more.
123122

123+
Debugging with pdb
124+
==================
125+
126+
In order to break into a regular pdb session on a systemd-controlled
127+
service, you need to invoke the process manually - that is, take it out
128+
of systemd's control.
129+
130+
Discover the command systemd is using to run the service::
131+
132+
systemctl show devstack@n-sch.service -p ExecStart --no-pager
133+
134+
Stop the systemd service::
135+
136+
sudo systemctl stop devstack@n-sch.service
137+
138+
Inject your breakpoint in the source, e.g.::
139+
140+
import pdb; pdb.set_trace()
141+
142+
Invoke the command manually::
143+
144+
/usr/local/bin/nova-scheduler --config-file /etc/nova/nova.conf
145+
124146
Known Issues
125147
============
126148

0 commit comments

Comments
 (0)