#!/bin/sh
#可以延后
sudo systemctl start NetworkManager-wait-online.service
sudo systemctl start smbd.service
sudo systemctl start pppd-dns.service
sudo systemctl start dns-clean.service
sudo systemctl start nmbd.service
#sudo systemctl start minissdpd.service
sudo systemctl start systemd-journal-flush.service
sudo systemctl start systemd-tmpfiles-clean.service
sudo systemctl start cups-browsed.service
sudo systemctl start binfmt-support.service
sudo systemctl start irqbalance.service
#sudo systemctl start paxctld.service
sudo systemctl start rmnologin.service
sudo systemctl start motd.service
sudo systemctl start saned.service
#sudo systemctl start exim4.service
sudo systemctl start ModemManager.service
sudo systemctl start cups.service
sudo systemctl start networking.service
sudo systemctl start auditapp.service
sudo systemctl start bluetooth.service
#sudo systemctl start samba-ad-dc.service 
sudo systemctl start speech-dispatcher.service 
sudo systemctl start ufw.service 
lvmstart()
{
	#Not start when fastboot enabled.
        sudo systemctl start lvm2-monitor.service
        sudo systemctl start lvm2-lvmetad.service
        sudo systemctl start lvm2-lvmpolld.service
        sudo systemctl start lvm2-lvmetad.socket
        sudo systemctl start lvm2-lvmpolld.socket
	sudo systemctl start cdos-antivirus-daemon.service
}
#Normal boot or fastboot, start lvm service
file='/etc/cdos-fastboot/cdos-fastboot.conf'
if [ -f "$file" ]; then
    var=`cat $file| grep STATE | awk -F "=" '{print $2}'`
    if [ "X$var" =  "Xoff" ]; then
	lvmstart
    fi
else
    lvmstart
fi
sudo systemctl start bootlogs.service
sudo systemctl start winbind.service
sleep 6
sudo systemctl start apt-daily.service
sudo systemctl start anacron.service
sudo systemctl start cron.service
sleep 60
echo 3 > /proc/sys/vm/drop_caches
