]> git.ipfire.org Git - people/stevee/network.git/commitdiff
Reduce startup time by letting systemd create our files in /run.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 May 2012 13:57:09 +0000 (13:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 May 2012 13:57:09 +0000 (13:57 +0000)
Makefile
functions.aiccu
functions.ppp
functions.wireless
network.tmpfiles [new file with mode: 0644]

index 84286cbdee5d53bb75a19ae71a050c576feb983f..a7cbeae9f9c14c05de56733ed39f0a6e9090f02b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@ libdir=$(prefix)/lib
 sysconfdir=/etc
 localstatedir=/var
 systemdunitdir=$(prefix)/lib/systemd/system
+tmpfilesdir=$(prefix)/lib/tmpfiles.d
 
 # File to store the version number in.
 VERSION_FILE = $(DESTDIR)$(libdir)/network/version
@@ -24,6 +25,7 @@ install:
        -mkdir -pv $(DESTDIR)$(localstatedir)/log/network
        -mkdir -pv $(DESTDIR)$(sbindir)
        -mkdir -pv $(DESTDIR)$(systemdunitdir)
+       -mkdir -pv $(DESTDIR)$(tmpfilesdir)
 
        install -m 755 -v network $(DESTDIR)$(sbindir)
 
@@ -32,6 +34,7 @@ install:
        cp -rfv udev/* $(DESTDIR)$(libdir)/udev
        cp -rfv network-* $(DESTDIR)$(libdir)/network/
        cp -vf  systemd/*.service $(DESTDIR)$(systemdunitdir)
+       cp -vf network.tmpfiles $(DESTDIR)$(tmpfilesdir)/network.conf
 
        # Install bridge-stp. 
        install -m 755 bridge-stp $(DESTDIR)$(sbindir)/
index 5a49eddc08a14d510545b39ef1abda5f16097d04..5c4d38bb322943d57200ed86a0e0cb35535a3d18 100644 (file)
 #                                                                             #
 ###############################################################################
 
-function aiccu_init() {
-       log INFO "Initializing aiccu."
-       mkdir -p $(aiccu_config_dir)
-}
-
-init_register aiccu_init
-
 function aiccu_config_dir() {
        local device=${1}
 
index ddc68f2ec1413256cf4ab010422f5c5e3d61e6f7..78b967e44d65679fed6cc13f7f9923e0689eecc3 100644 (file)
 #                                                                             #
 ###############################################################################
 
-function ppp_init() {
-       mkdir -p /var/run/ppp 2>/dev/null
-}
-
-init_register ppp_init
-
 function ppp_common_ip_pre_up() {
        local zone=${1}
        shift
index 6353d0d70a008cb7eb99cdfc9e5d411f9ac3ca57..2cd19c57153d6271ae5de82006ea6d8811821797 100644 (file)
@@ -123,12 +123,6 @@ function wireless_set_channel() {
        iw dev ${device} set channel ${channel} $@
 }
 
-function hostapd_init() {
-       mkdir -p $(hostapd_config_dir)
-}
-
-init_register hostapd_init
-
 function hostapd_config_dir() {
        local device=${1}
        
diff --git a/network.tmpfiles b/network.tmpfiles
new file mode 100644 (file)
index 0000000..9eb4380
--- /dev/null
@@ -0,0 +1,9 @@
+# Create the runtime directory for network.
+# This will hold temporary configuration files,
+# PID files and much more.
+d /run/network          0755 root   root   -
+d /run/network/aiccu    0755 root   root   -
+d /run/network/hostapd  0755 root   root   -
+
+# Point-to-point protocol daemon
+d /run/ppp              0755 root   root   -