Decrease startup time
Submitted by Paul Menzel
Assigned to ModemManager bug user
Description
Using ModemManager 1.6.2 from Debian Sid/unstable systemd-analyze
shows, that it takes over 100 ms to start up.
On Thomas Haller’s Fedora/Red Hat(?) system, it took 145 ms.
On my system, with a slow processor, and a rotating disk, it takes several settings.
$ systemd-analyze blame | grep ModemManager
14.707s ModemManager.service
$ systemctl status ModemManager
● ModemManager.service - Modem Manager
Loaded: loaded (/lib/systemd/system/ModemManager.service; enabled; vendor preset: enabled)
Active: active (running) since Mo 2016-10-03 08:47:02 CEST; 2h 1min ago
Main PID: 855 (ModemManager)
Tasks: 3 (limit: 4915)
CGroup: /system.slice/ModemManager.service
└─855 /usr/sbin/ModemManager
Okt 03 08:46:48 myasrocke350m1 systemd[1]: Starting Modem Manager...
Okt 03 08:46:52 myasrocke350m1 ModemManager[855]: <info> ModemManager (version 1.6.2) starting in system bus...
Okt 03 08:47:02 myasrocke350m1 systemd[1]: Started Modem Manager.
Okt 03 08:47:05 myasrocke350m1 ModemManager[855]: <info> Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:13.2/usb2/2-2':
Okt 03 08:47:05 myasrocke350m1 ModemManager[855]: <info> Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:15.1/0000:03:00.
$ systemctl cat ModemManager
# /lib/systemd/system/ModemManager.service
[Unit]
Description=Modem Manager
After=syslog.target
[Service]
Type=dbus
BusName=org.freedesktop.ModemManager1
ExecStart=/usr/sbin/ModemManager
StandardError=null
Restart=on-abort
[Install]
WantedBy=multi-user.target
Alias=dbus-org.freedesktop.ModemManager1.service
As a workaround, ModemManager could notify much earlier that it has started up. If I understood Thomas Haller correctly, NetworkManager notifies a successful startup right after having acquired the bus.
But I think, on most systems, ModemManager shouldn’t be started at all as a startup service, as the majority of users (95 %) don’t use it, or don’t use it as a service, which needs to be present before logging into the system, and for example browsing the Web.
Isn’t there a way, that NetworkManager starts ModemManager, when it sees it’s needed, or that it’s started by the user session, or the login manager like GDM.
Then ModemManager doesn’t consume resources during the initial startup, and the system can start faster.
Version: git master