Commit 3ac5262
authored
[Services] Keep Process Compose alive in background, add
## Summary
This fixes two previously reported issues:
1. If process-compose is not terminated gracefully (e.g., it's parent
shell crashes, or is closed on accident), then process-compose may
terminate without also terminating it's services.
2. If process-compose is started in the background, a user can now run
the `attach` command to re-attach the TUI to the backgrounded process
compose
A few current limitations:
1. This only applies to `devbox services up -b`, but could be extended
to `devbox services up` as well by starting process-compose in the
background, and then attaching the TUI
2. You will now need to explicitly run `devbox services stop` to stop
process-compose for your project
Todos:
1. Should we apply the backgrounding to `devbox services up` as well?
2. Should we allow users to specify a port or specific process-compose
instance to attach to?
3. If so, should we list the process-compose instances somewhere?
## How was it tested?
Tested on the Apache example:
Attach:
1. Run `devbox services up -b` in the apache folder
2. Run `devbox services attach` in the apache folder, verify that it
launches the TUI
3. Hit Ctrl-C to exit the TUI
Backgrounding:
4. Run `devbox services list`, verify that process-compose is still
running
5. Terminate your shell or editor
6. Launch a new shell or editor, navigate to the apache example
7. Run `devbox services list` to verify that process-compose is still
running.attach command (#2269)1 parent df187b9 commit 3ac5262
File tree
3 files changed
+84
-2
lines changed- internal
- boxcli
- devbox
- services
3 files changed
+84
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
| 135 | + | |
126 | 136 | | |
127 | 137 | | |
128 | 138 | | |
| |||
131 | 141 | | |
132 | 142 | | |
133 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
134 | 157 | | |
135 | 158 | | |
136 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
173 | 198 | | |
174 | 199 | | |
175 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
219 | 226 | | |
220 | 227 | | |
221 | 228 | | |
222 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
223 | 233 | | |
224 | 234 | | |
225 | 235 | | |
| |||
293 | 303 | | |
294 | 304 | | |
295 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
296 | 330 | | |
297 | 331 | | |
298 | 332 | | |
| |||
0 commit comments