Synchronous cleanup on exit.
(self)
| 1126 | self.reap_workers() |
| 1127 | |
| 1128 | def _cleanup_sync(self): |
| 1129 | """Synchronous cleanup on exit.""" |
| 1130 | # Remove PID file |
| 1131 | if self.pidfile and os.path.exists(self.pidfile): |
| 1132 | try: |
| 1133 | os.unlink(self.pidfile) |
| 1134 | except OSError: |
| 1135 | pass |
| 1136 | |
| 1137 | # Clean up socket |
| 1138 | if os.path.exists(self.socket_path): |
| 1139 | try: |
| 1140 | os.unlink(self.socket_path) |
| 1141 | except OSError: |
| 1142 | pass |
| 1143 | |
| 1144 | # Clean up temp directory |
| 1145 | try: |
| 1146 | for f in os.listdir(self.tmpdir): |
| 1147 | os.unlink(os.path.join(self.tmpdir, f)) |
| 1148 | os.rmdir(self.tmpdir) |
| 1149 | except OSError: |
| 1150 | pass |
| 1151 | |
| 1152 | self.log.info("Dirty arbiter exiting (pid: %s)", self.pid) |