Score:0

Parallel starting of services at the time of boot

in flag

I am having a bit slow boot because of many services. Services listed below (Output for sudo ls -l /etc/rc$(sudo runlevel| awk '{print $2}').d):

lrwxrwxrwx 1 root root 18 Mar 21  2020 K01whoopsie -> ../init.d/whoopsie
lrwxrwxrwx 1 root root 15 Mar 21  2020 S01acpid -> ../init.d/acpid
lrwxrwxrwx 1 root root 17 Mar 21  2020 S01anacron -> ../init.d/anacron
lrwxrwxrwx 1 root root 16 Mar 21  2020 S01apport -> ../init.d/apport
lrwxrwxrwx 1 root root 22 Mar 21  2020 S01avahi-daemon -> ../init.d/avahi-daemon
lrwxrwxrwx 1 root root 19 Mar 21  2020 S01bluetooth -> ../init.d/bluetooth
lrwxrwxrwx 1 root root 26 Mar 21  2020 S01console-setup.sh -> ../init.d/console-setup.sh
lrwxrwxrwx 1 root root 14 Mar 21  2020 S01cron -> ../init.d/cron
lrwxrwxrwx 1 root root 14 Mar 21  2020 S01cups -> ../init.d/cups
lrwxrwxrwx 1 root root 22 Mar 21  2020 S01cups-browsed -> ../init.d/cups-browsed
lrwxrwxrwx 1 root root 14 Mar 21  2020 S01dbus -> ../init.d/dbus
lrwxrwxrwx 1 root root 16 Dec 31 23:43 S01docker -> ../init.d/docker
lrwxrwxrwx 1 root root 14 Mar 21  2020 S01gdm3 -> ../init.d/gdm3
lrwxrwxrwx 1 root root 21 Mar 21  2020 S01grub-common -> ../init.d/grub-common
lrwxrwxrwx 1 root root 20 Mar 21  2020 S01irqbalance -> ../init.d/irqbalance
lrwxrwxrwx 1 root root 20 Mar 21  2020 S01kerneloops -> ../init.d/kerneloops
lrwxrwxrwx 1 root root 14 Dec  9 21:21 S01nmbd -> ../init.d/nmbd
lrwxrwxrwx 1 root root 17 Dec 12 22:31 S01openvpn -> ../init.d/openvpn
lrwxrwxrwx 1 root root 18 Mar 21  2020 S01plymouth -> ../init.d/plymouth
lrwxrwxrwx 1 root root 17 May  6 20:56 S01postfix -> ../init.d/postfix
lrwxrwxrwx 1 root root 15 Mar 21  2020 S01rsync -> ../init.d/rsync
lrwxrwxrwx 1 root root 17 Mar 21  2020 S01rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root 21 Dec  9 21:21 S01samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Mar 21  2020 S01saned -> ../init.d/saned
lrwxrwxrwx 1 root root 23 May  6 20:56 S01smartmontools -> ../init.d/smartmontools
lrwxrwxrwx 1 root root 14 Dec  9 21:21 S01smbd -> ../init.d/smbd
lrwxrwxrwx 1 root root 27 Mar 21  2020 S01speech-dispatcher -> ../init.d/speech-dispatcher
lrwxrwxrwx 1 root root 23 Mar 21  2020 S01spice-vdagent -> ../init.d/spice-vdagent
lrwxrwxrwx 1 root root 13 Dec  9 21:15 S01ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 18 Dec 12 23:22 S01stunnel4 -> ../init.d/stunnel4
lrwxrwxrwx 1 root root 29 Mar 21  2020 S01unattended-upgrades -> ../init.d/unattended-upgrades
lrwxrwxrwx 1 root root 15 Mar 21  2020 S01uuidd -> ../init.d/uuidd
lrwxrwxrwx 1 root root 24 Dec 12 23:22 S01windscribe-cli -> ../init.d/windscribe-cli

I want to make these services start in parallel during the boot and I think this code will do the job for the same level services to be executed parallelly:

for i in /etc/rc$runlevel.d/S*
do
 case "$runlevel" in
  0|6) startup $i stop ;;
  *) startup $i start ;;
 esac
done

But the problem is I don't know where should I put this code. I can't even find /etc/init.d/rc script

FedKad avatar
cn flag
Does `systemd` use `init` scripts? I don't think so...
Techno world avatar
in flag
I referred this [blog](https://www.linux.com/news/boot-faster-parallel-starting-services/)
FedKad avatar
cn flag
I admit that I am not expert on this topic (and I hope somebody with better knowledge will comment or answer your question); however, are you aware that your reference is more than 15 years old?
Techno world avatar
in flag
Yes, i am. That's why i am finding an answer for newer kernel. Maybe by modifying systemd or something to work, idk
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.