1
0
mirror of synced 2024-11-21 20:46:10 +03:00

Improve services on boot

- Systemd may run rc.local early during system boot
- Insert delay so that services can start correctly
This commit is contained in:
hwdsl2 2017-06-21 00:02:03 -05:00
parent 5e3689198f
commit cf595eaee7
2 changed files with 4 additions and 5 deletions

View File

@ -432,14 +432,12 @@ if ! grep -qs "hwdsl2 VPN script" /etc/rc.local; then
cat >> /etc/rc.local <<'EOF'
# Added by hwdsl2 VPN script
(sleep 15
service ipsec start
service xl2tpd start
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_forward)&
exit 0
EOF
if grep -qs raspbian /etc/os-release; then
sed --follow-symlinks -i '/hwdsl2 VPN script/a sleep 15' /etc/rc.local
fi
fi
bigecho "Starting services..."

View File

@ -418,10 +418,11 @@ if ! grep -qs "hwdsl2 VPN script" /etc/rc.local; then
cat >> /etc/rc.local <<'EOF'
# Added by hwdsl2 VPN script
(sleep 15
modprobe -q pppol2tp
service ipsec restart
service xl2tpd restart
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_forward)&
EOF
fi