File: 0001-optimize-boot.patch

package info (click to toggle)
ufw 0.36.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,372 kB
  • sloc: python: 8,731; sh: 5,968; makefile: 200
file content (21 lines) | stat: -rw-r--r-- 736 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
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).

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