File: 0001-optimize-boot.patch

package info (click to toggle)
ufw 0.36.2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,824 kB
  • sloc: python: 8,731; sh: 5,950; makefile: 200
file content (22 lines) | stat: -rw-r--r-- 758 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Author: Jamie Strandboge <jdstrand@ubuntu.com>
Description: to improve boot speed when disabled, don't source all of
 ufw-init-functions (which also sources in other files).
Forwarded: not-needed

Index: ufw-0.36.1/src/ufw-init
===================================================================
--- ufw-0.36.1.orig/src/ufw-init
+++ ufw-0.36.1/src/ufw-init
@@ -31,6 +31,12 @@ if [ "$1" = "--datadir" ] && [ -n "$2" ]
 fi
 export DATA_DIR="$datadir"
 
+# Debian/Ubuntu: small boot speed improvement
+. "${rootdir}#CONFIG_PREFIX#/ufw/ufw.conf"
+if [ "$1" = "start" ] && [ "$2" = "quiet" ] && [ "$ENABLED" = "no" ]; then
+    exit 0
+fi
+
 if [ -s "${rootdir}#STATE_PREFIX#/ufw-init-functions" ]; then
     . "${rootdir}#STATE_PREFIX#/ufw-init-functions"
 else