[blfs-book] r10994 - in trunk: BOOK bootscripts bootscripts/blfs/services

krejzi at higgs.linuxfromscratch.org krejzi at higgs.linuxfromscratch.org
Sun Feb 3 19:15:00 PST 2013


Author: krejzi
Date: Sun Feb  3 19:14:59 2013
New Revision: 10994

Log:
Added wpa service, small modifications to dhclient network services and bumped bootscripts.

Added:
   trunk/bootscripts/blfs/services/wpa   (contents, props changed)
Modified:
   trunk/BOOK/general.ent
   trunk/bootscripts/ChangeLog
   trunk/bootscripts/Makefile
   trunk/bootscripts/blfs/services/dhclient

Modified: trunk/BOOK/general.ent
==============================================================================
--- trunk/BOOK/general.ent	Sun Feb  3 06:24:15 2013	(r10993)
+++ trunk/BOOK/general.ent	Sun Feb  3 19:14:59 2013	(r10994)
@@ -3,13 +3,13 @@
 $Date$
 -->
 
-<!ENTITY day          "03">                   <!-- Always 2 digits -->
+<!ENTITY day          "04">                   <!-- Always 2 digits -->
 <!ENTITY month        "02">                   <!-- Always 2 digits -->
 <!ENTITY year         "2013">
 <!ENTITY copyrightdate "2001-&year;">
 <!ENTITY copyholder   "The BLFS Development Team">
 <!ENTITY version      "&year;-&month;-&day;">
-<!ENTITY releasedate  "February 3rd, &year;">
+<!ENTITY releasedate  "February 4th, &year;">
 <!ENTITY pubdate      "&year;-&month;-&day;"> <!-- metadata req. by TLDP -->
 <!ENTITY blfs-version "svn">                  <!-- svn|[release #] -->
 <!ENTITY lfs-version  "development">          <!-- version|testing|unstable|development] -->
@@ -66,7 +66,7 @@
 <!ENTITY lfs-vim-version              "7.3">
 <!-- End LFS versions -->
 
-<!ENTITY blfs-bootscripts-version     "20130127">
+<!ENTITY blfs-bootscripts-version     "20130204">
 <!ENTITY blfs-bootscripts-download    "&downloads-root;/blfs-bootscripts-&blfs-bootscripts-version;.tar.bz2">
 
 <!ENTITY blfs-wiki                    "http://wiki.&lfs-domainname;/blfs/wiki">

Modified: trunk/bootscripts/ChangeLog
==============================================================================
--- trunk/bootscripts/ChangeLog	Sun Feb  3 06:24:15 2013	(r10993)
+++ trunk/bootscripts/ChangeLog	Sun Feb  3 19:14:59 2013	(r10994)
@@ -1,3 +1,7 @@
+2013-02-04 Armin K. <krejzi at email.com>
+   * Added network service for wpa_supplicant
+   * Minor modifications to dhclient network service
+
 2012-08-26 Bruce Dubbs <bdubbs at linuxfromscratch.org>
    * Restore winbindd script
 

Modified: trunk/bootscripts/Makefile
==============================================================================
--- trunk/bootscripts/Makefile	Sun Feb  3 06:24:15 2013	(r10993)
+++ trunk/bootscripts/Makefile	Sun Feb  3 19:14:59 2013	(r10994)
@@ -37,6 +37,9 @@
 	install -d -m ${DIRMODE} ${EXTDIR}/ppp/peers
 	install -m ${CONFMODE} blfs/ppp/pppoe ${EXTDIR}/ppp/peers
 
+install-service-wpa: create-service-dir
+	install -m ${MODE} blfs/services/wpa ${LIBDIR}
+
 install-alsa: create-dirs
 	install -m ${MODE} blfs/init.d/alsa       ${EXTDIR}/rc.d/init.d/
 	ln -sf  ../init.d/alsa ${EXTDIR}/rc.d/rc0.d/K35alsa

Modified: trunk/bootscripts/blfs/services/dhclient
==============================================================================
--- trunk/bootscripts/blfs/services/dhclient	Sun Feb  3 06:24:15 2013	(r10993)
+++ trunk/bootscripts/blfs/services/dhclient	Sun Feb  3 19:14:59 2013	(r10994)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # Begin services/dhclient
 
 # Origianlly based upon lfs-bootscripts-1.12 $NETWORK_DEVICES/if{down,up}
@@ -31,9 +31,15 @@
 
 case "$2" in
    up)
-      log_info_msg "\nStarting dhclient on the $1 interface..."
 
-      exec /sbin/dhclient -lf /var/lib/dhclient/dhclient-$1.leases -pf /var/run/dhclient-$1.pid $DHCP_START $1
+     if [ -e /run/dhclient-$1.pid ]; then
+        log_warning_msg "\n dhclient appears to be running on $1"
+        exit 0
+     fi
+
+      log_info_msg "\n Starting dhclient on the $1 interface..."
+
+      /sbin/dhclient -lf /var/lib/dhclient/dhclient-$1.leases -pf /run/dhclient-$1.pid $DHCP_START $1
 
       if [ "$?" != "0" ]; then
         log_failure_msg2
@@ -77,9 +83,15 @@
    ;;
 
    down)
-      log_info_msg "Stopping dhclient on the $1 interface..."
+      if [ ! -e /run/dhclient-$1.pid ]; then
+         log_warning_msg "dhclient doesn't appear to be running on $1"
+         exit 0
+      fi
+
+      log_info_msg "\n Stopping dhclient on the $1 interface..."
 
-      exec /sbin/dhclient -r -lf /var/lib/dhclient/dhclient-$1.leases -pf /var/run/dhclient-$1.pid $DHCP_STOP $1
+      /sbin/dhclient -r -lf /var/lib/dhclient/dhclient-$1.leases -pf /run/dhclient-$1.pid $DHCP_STOP $1
+      rm -f /run/dhclient-$1.pid
       evaluate_retval
    ;;
 

Added: trunk/bootscripts/blfs/services/wpa
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/bootscripts/blfs/services/wpa	Sun Feb  3 19:14:59 2013	(r10994)
@@ -0,0 +1,80 @@
+#!/bin/bash
+# Begin services/wpa
+
+# Origianlly based upon lfs-bootscripts-1.12 $NETWORK_DEVICES/if{down,up}
+# Written by Armin K. <krejzi at email dot com>
+
+# Call with: IFCONFIG=<filename> /lib/services/wpa <IFACE> <up | down>
+
+#$LastChangedBy$
+#$Date$
+
+. /lib/lsb/init-functions
+. $IFCONFIG
+
+case "$2" in
+   up)
+
+      if [ -e /run/wpa_supplicant/$1.pid ]; then
+         log_warning_msg "\n wpa_supplicant already running on $1."
+         exit 0
+      fi
+
+      if [ ! -e /etc/sysconfig/wpa_supplicant-$1.conf ]; then
+        log_info_msg "\n wpa_supplicant configuration file not present"
+        log_failure_msg2
+        exit 1
+      fi
+
+      log_info_msg "\n Starting wpa_supplicant on the $1 interface..."
+
+      mkdir -p /run/wpa_supplicant
+
+      /sbin/wpa_supplicant -q -B -Dnl80211,wext -P/run/wpa_supplicant/$1.pid -C/run/wpa_supplicant -c/etc/sysconfig/wpa_supplicant-$1.conf -i$1
+
+      if [ "$?" != "0" ]; then
+        log_failure_msg2
+        exit 1
+      fi
+
+      log_success_msg2
+
+      if [ -n "${WPA_SERVICE}" ]; then
+         if [ ! -e /lib/services/${WPA_SERVICE} -a ! -x /lib/services/${WPA_SERVICE} ]; then
+            log_info_msg "\n Cannot start ${WPA_SERVICE} on $1"
+            log_failure_msg2
+            exit 1
+         fi
+
+         IFCONFIG=${IFCONFIG} /lib/services/${WPA_SERVICE} $1 up
+      fi
+   ;;
+
+   down)
+      if [ -n "${WPA_SERVICE}" ]; then
+         if [ ! -e /lib/services/${WPA_SERVICE} -a ! -x /lib/services/${WPA_SERVICE} ]; then
+            log_warning_msg "\n Cannot stop ${WPA_SERVICE} on $1"
+         else
+            IFCONFIG=${IFCONFIG} /lib/services/${WPA_SERVICE} $1 down
+         fi
+      fi
+
+      log_info_msg "\n Stopping wpa_supplicant on the $1 interface..."
+
+      if [ -e /run/wpa_supplicant/$1.pid ]; then
+         kill -9 $(cat /run/wpa_supplicant/$1.pid)
+         rm -f /run/wpa_supplicant/$1.pid /run/wpa_supplicant/$1
+         evaluate_retval
+      else
+         log_warning_msg "\n wpa_supplicant already stopped on $1"
+         exit 0
+      fi
+   ;;
+
+   *)
+      echo "Usage: $0 [interface] {up|down}"
+      exit 1
+   ;;
+esac
+
+# End services/wpa



More information about the blfs-book mailing list