Commit c71834f
committed
Automatically start Docker daemon after installation by default
This PR makes the Docker daemon start automatically after installation
by default, with a --no-autostart opt-out flag. This addresses issue #124
and aligns with the "opinionated convenience" philosophy of get.docker.com.
Changes:
- Autostart enabled by default (AUTOSTART=1)
- Added --no-autostart flag to opt-out
- Smart systemd detection using /run/systemd/system directory check
- Falls back to traditional service management (service/chkconfig/update-rc.d)
- Uses sh_c pattern for proper dry-run support
- All informational messages output to stderr
The systemd detection checks for /run/systemd/system directory which only
exists when systemd is actually running as PID 1. This prevents failures
in container environments where systemctl is installed but systemd is not
running.
Tested across all supported distributions:
- Ubuntu (20.04, 22.04, 24.04)
- Debian (11, 12)
- CentOS Stream (8, 9)
- Fedora (40, 41)
- RHEL/AlmaLinux (8, 9)
Fixes #124
Signed-off-by: Gajesh Bhat <[email protected]>1 parent a00c5c3 commit c71834f
1 file changed
+85
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
86 | 98 | | |
87 | 99 | | |
88 | 100 | | |
| |||
119 | 131 | | |
120 | 132 | | |
121 | 133 | | |
| 134 | + | |
122 | 135 | | |
123 | 136 | | |
124 | 137 | | |
| |||
140 | 153 | | |
141 | 154 | | |
142 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
143 | 159 | | |
144 | 160 | | |
145 | 161 | | |
| |||
280 | 296 | | |
281 | 297 | | |
282 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 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 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
283 | 362 | | |
284 | 363 | | |
285 | 364 | | |
| |||
582 | 661 | | |
583 | 662 | | |
584 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
585 | 667 | | |
586 | 668 | | |
587 | 669 | | |
| |||
689 | 771 | | |
690 | 772 | | |
691 | 773 | | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
692 | 777 | | |
693 | 778 | | |
694 | 779 | | |
| |||
0 commit comments