After removing most of the services that I don't need, it still takes about 28 seconds to boot, take a picture and shut down. I would like to lower this even more, and I did a systemd-analyze blame and got the following:
7.476s disableusb.service 1.736s keyboard-setup.service 958ms kbd.service 789ms systemd-fsck-root.service 737ms systemd-setup-dgram-qlen.service 722ms fake-hwclock.service 580ms kmod-static-nodes.service 565ms console-setup.service 534ms dev-mqueue.mount 518ms systemd-udev-trigger.service 498ms networking.service 489ms raspi-config.service 449ms hdparm.service 444ms systemd-journal-flush.service 376ms systemd-tmpfiles-setup.service 375ms dhcpcd.service 345ms systemd-logind.service 332ms ntp.service 317ms systemd-modules-load.service 281ms tmp.mount 272ms triggerhappy.service 269ms sys-kernel-debug.mount 265ms [email protected] 223ms rsyslog.service 221ms sys-kernel-config.mount 212ms systemd-tmpfiles-setup-dev.service 200ms systemd-remount-fs.service 198ms systemd-sysctl.service 184ms boot.mount 173ms systemd-random-seed.service 168ms rc-local.service 167ms [email protected] 165ms var-log.mount 141ms udev-finish.service 130ms sys-fs-fuse-connections.mount 111ms systemd-user-sessions.service 94ms systemd-update-utmp.service 94ms alsa-restore.service 93ms systemd-update-utmp-runlevel.service 77ms systemd-udevd.service 55ms takepicture.service disableusb.service is mine, and unlike what the name implies it does other things as well. I doubt I can improve the time there.
My system is running headless, by serial. I only need networking via wifi (wifi doesn't start because I disable the usb power, but sometimes I won't disable it, so that it can start).
Looking at this list, I see things such as: 1.736s keyboard-setup.service and 958ms kbd.service. They take almost 3 seconds. Do I need them if I am not using a keyboard? If not, how do I disable them?
What else can I safely disable from here?
Ok, there is something really strange going here. I disabled some more services, and it still takes that long in total, only that now some services that took less time before take much longer...
7.468s disableusb.service 1.676s console-setup.service 768ms systemd-logind.service 768ms systemd-fsck-root.service 726ms systemd-setup-dgram-qlen.service 714ms fake-hwclock.service 689ms networking.service 530ms systemd-journal-flush.service 524ms systemd-udev-trigger.service 509ms dev-mqueue.mount 509ms ntp.service 508ms kmod-static-nodes.service 439ms dhcpcd.service 334ms systemd-random-seed.service 331ms hdparm.service 318ms systemd-modules-load.service 281ms systemd-tmpfiles-setup.service 279ms [email protected] 279ms rsyslog.service 269ms systemd-remount-fs.service 265ms sys-kernel-config.mount 254ms systemd-tmpfiles-setup-dev.service 250ms systemd-sysctl.service 238ms rc-local.service 234ms systemd-udevd.service 232ms sys-kernel-debug.mount 224ms [email protected] 187ms tmp.mount 176ms sys-fs-fuse-connections.mount 175ms var-log.mount 133ms systemd-update-utmp.service 122ms systemd-update-utmp-runlevel.service 122ms systemd-user-sessions.service 119ms alsa-restore.service 91ms boot.mount 88ms udev-finish.service 76ms takepicture.service Service file: (no idea why the code syntax doesn't work)
[Unit] Description=Disable USB power Before=networking.service After=local-fs.target DefaultDependencies=no [Service] Type=oneshot ExecStart=/sbin/usb_down [Install] Here is the plot: http://www.eternal-lands.com/plot.svg

systemd-analyze plotand include the image here (that should produce a nice SVG chart showing the timings and maybe will clear things up).disableusb.service. BTW, you can quicklyconvert plog.svg plog.jpgif you install theimagemagickpackage/