由於許多服務,我的啟動速度有點慢。下面列出的服務(輸出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
我想讓這些服務在啟動過程中並行啟動,我認為這段程式碼將完成並行執行相同級別服務的工作:
for i in /etc/rc$runlevel.d/S*
do
case "$runlevel" in
0|6) startup $i stop ;;
*) startup $i start ;;
esac
done
但問題是我不知道該把這段程式碼放在哪裡。我甚至找不到 /etc/init.d/rc 腳本