Browse code

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

Eric Fried authored on 2017/09/08 03:36:00
Showing 1 changed files
... ...
@@ -98,8 +98,7 @@ Follow logs for a specific service::
98 98
 
99 99
 Following logs for multiple services simultaneously::
100 100
 
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
103 102
 
104 103
 or you can even do wild cards to follow all the nova services::
105 104
 
... ...
@@ -121,6 +120,29 @@ left/right arrow keys.
121 121
 
122 122
 See ``man 1 journalctl`` for more.
123 123
 
124
+Debugging with pdb
125
+==================
126
+
127
+In order to break into a regular pdb session on a systemd-controlled
128
+service, you need to invoke the process manually - that is, take it out
129
+of systemd's control.
130
+
131
+Discover the command systemd is using to run the service::
132
+
133
+  systemctl show devstack@n-sch.service -p ExecStart --no-pager
134
+
135
+Stop the systemd service::
136
+
137
+  sudo systemctl stop devstack@n-sch.service
138
+
139
+Inject your breakpoint in the source, e.g.::
140
+
141
+  import pdb; pdb.set_trace()
142
+
143
+Invoke the command manually::
144
+
145
+  /usr/local/bin/nova-scheduler --config-file /etc/nova/nova.conf
146
+
124 147
 Known Issues
125 148
 ============
126 149