Heyas
We alll know the BLAME GAME, but its kind of annoying to disable services, just to see them to be started at next reboot anyway.
Or even worse, boot time takes longer than it previously took.
I have this script which should do the most work, but as of now, but i have a few questions, as i ran into an unusable system serveral times (due to several services that must be loaded).
(Replace sT, sP, sE with echo)
PHP Code:
#!/bin/bash
# |
# | Service Performance script, August 1st 2011 by sea
# |
# | This script is written with best intention to help,
# | but there is NO warranty and I deny ANY responsiblity
# | that may or may not affect your system.
# |
# | Lisence: GPL v3
# | Author: Simon A. Erat (sea)
# | Date Created: 2011 August 1st
# | Date Changed: 2012 May 10
script_version="0.5"
# | Resource URL:
# | Release URL:
# |
# | Variables
etc=/etc/systemd/system
lib=/lib/systemd/system
FORBIDDEN_ITEMS="
.boot.mount
.media.mount
.home.mount
.remount-rootfs.service
.sys-fs-fuse-connections.mount
.systemd-remount-api-vfs.service
.systemd-tmpfiles-setup
.udev-trigger.service
.irqbalance.service
"
# To disable any of the above service/mount may result in an unusable system!
USEFUL_services="
.systemd-readahead-collect
.systemd-readahead-replay
.mcelog
"
toDisable="
avahi-daemon
livesys
livesys-late
sendmail
sandbox
udev-settle
ip6tables
"
toDisMount="
sys-kernel-security
sys-kernel-config
sys-kernel-debug
dev-mqueue
dev-hugepages
"
# |
# | Input
if ! ask "Do you have SCSI devices?"
then toDisable="$toDisable
iscsi
iscsid"
fi
if ! ask "Do you have any virtual, software or physical RAID, OR are using LVM?"
then toDisable="$toDisable
lvm2-monitor
mdmonitor
mdmonitor-takeover
fedora-loadmodules
fedora-storage-init
fedora-wait-storage
fedora-storage-init-late
"
fi
if ! ask "Do you use a NAS (smb/nfs)?"
then toDisable="$toDisable
netfs
nfs-idmap
nfs-lock
var-lib-nfs-rpc_pipefs
"
fi
# |
# | Outout
sT "sea Service tweaks ($script_version)"
sE
sE "Use at your own risk!"
press
sE "Going to disable these services:"
echo "$toDisable"
sE "As well as these mounts:"
echo "$toDisMount"
sE "-------------------------------"
for service in $toDisable
do sP "Working with service: $service" "$PROGRESS"
if [ "." = "${service:0:1}" ] || [ ! -f $etc/$service.service ]
then sE "Not found service: $service" "$SKIP"
else sudo systemctl stop $service.service
sudo systemctl disable $service.service && ret="$SUCCESS" || ret="$FAILURE"
sudo ln -sf /dev/zero $etc/$service.service
sE "Worked with service: $service" "$ret"
fi
done
for mount in $toDisMount
do sP "Working with mount: $mount" "$PROGRESS"
if [ "." = "${mount:0:1}" ] || [ ! -f $etc/$mount.mount ]
then sE "Not found mount: $mount" "$SKIP"
else sudo systemctl stop $mount.mount
sudo systemctl disable $mount.mount && ret="$SUCCESS" || ret="$FAILURE"
sudo ln -sf /dev/zero $etc/$mount.mount
sE "Worked with mount: $mount" "$ret"
fi
done
My main question are the following 4 tops, which make 4/5 of the total effective boot time, or 50% of accumulated boot time.
Or, in other words, why the heck to these 4 services take so much time?
Code:
[simon@nc210 ~]$ blame
Year / Month / Day : 2012 05 16
6091ms udev-settle.service
5614ms systemd-vconsole-setup.service
4021ms fedora-readonly.service
2477ms remount-rootfs.service
2241ms media.mount
1940ms udev-trigger.service
1094ms udev.service
939ms NetworkManager.service
933ms systemd-remount-api-vfs.service
898ms systemd-sysctl.service
848ms rtkit-daemon.service
700ms rsyslog.service
692ms avahi-daemon.service
666ms systemd-logind.service
528ms console-kit-log-system-start.service
486ms iptables.service
484ms ip6tables.service
470ms fedora-storage-init.service
442ms auditd.service
439ms sshd-keygen.service
378ms dbus.service
342ms fedora-storage-init-late.service
324ms abrt-ccpp.service
322ms abrt-vmcore.service
311ms systemd-tmpfiles-setup.service
304ms boot.mount
257ms systemd-user-sessions.service
208ms systemd-readahead-collect.service
178ms systemd-readahead-replay.service
159ms home.mount
128ms fedora-wait-storage.service
71ms console-kit-daemon.service
34ms proc-sys-fs-binfmt_misc.mount
26ms rpcbind.service
1ms sys-fs-fuse-connections.mount
35 services: Total = 35.046 seconds
Startup finished in 2787ms (kernel) + 5506ms (initramfs) + 12192ms (userspace) = 20486ms
[simon@nc210 ~]$ blame >> blame.log
* Udev still is a hughe ? to me.
* All of the fedora*-services i'm disabling by default, as they're mainly for LVM which i dont use.
* Why does enabling 6? virtual consoles take so much time? (systemd-vconsole-setup.service)
* Finaly, remounting rootfs shouldnt take 2.5 sec,as /home just uses ~400ms but beeing 10 times larger.
---------- Post added at 10:08 AM ---------- Previous post was at 01:01 AM ----------
Another question:
Have you guys and preferncfes for the one or the other service to disable them 'specialy'?
I mean, are there some servcies that have to be handled diffrently that: stop; disable.; symlink from /dev/null?