Author: krejzi Date: Mon Jun 10 14:51:18 2013 New Revision: 11284 Log: Import systemd units into systemd branch.
Added: branches/systemd/units/ branches/systemd/units/ChangeLog branches/systemd/units/LICENSE branches/systemd/units/MAINTAINERS branches/systemd/units/README branches/systemd/units/blfs/ branches/systemd/units/blfs/default/ branches/systemd/units/blfs/default/dhcpd branches/systemd/units/blfs/default/samba branches/systemd/units/blfs/default/saslauthd branches/systemd/units/blfs/default/slapd branches/systemd/units/blfs/default/svnserve branches/systemd/units/blfs/default/winbindd branches/systemd/units/blfs/services/ branches/systemd/units/blfs/services/bridge branches/systemd/units/blfs/services/dhclient branches/systemd/units/blfs/services/dhcpcd branches/systemd/units/blfs/services/wpa branches/systemd/units/blfs/tmpfiles/ branches/systemd/units/blfs/tmpfiles/httpd.conf branches/systemd/units/blfs/tmpfiles/mysqld.conf branches/systemd/units/blfs/tmpfiles/named.conf branches/systemd/units/blfs/tmpfiles/nscd.conf branches/systemd/units/blfs/tmpfiles/postgresql.conf branches/systemd/units/blfs/tmpfiles/samba.conf branches/systemd/units/blfs/tmpfiles/saslauthd.conf branches/systemd/units/blfs/tmpfiles/slapd.conf branches/systemd/units/blfs/tmpfiles/sshd.conf branches/systemd/units/blfs/tmpfiles/svnserve.conf branches/systemd/units/blfs/units/ branches/systemd/units/blfs/units/acpid.service branches/systemd/units/blfs/units/acpid.socket branches/systemd/units/blfs/units/dhcpd.service branches/systemd/units/blfs/units/httpd.service branches/systemd/units/blfs/units/kdm.service branches/systemd/units/blfs/units/krb5-kadmind.service branches/systemd/units/blfs/units/krb5-kdc.service branches/systemd/units/blfs/units/krb5-kpropd.service branches/systemd/units/blfs/units/mysqld.service branches/systemd/units/blfs/units/named.service branches/systemd/units/blfs/units/nmbd.service branches/systemd/units/blfs/units/nscd.service branches/systemd/units/blfs/units/ntpd.service branches/systemd/units/blfs/units/postfix.service branches/systemd/units/blfs/units/postgresql.service branches/systemd/units/blfs/units/saslauthd.service branches/systemd/units/blfs/units/slapd.service branches/systemd/units/blfs/units/smbd.service branches/systemd/units/blfs/units/smbd.socket branches/systemd/units/blfs/units/smbdat.service branches/systemd/units/blfs/units/sshd.service branches/systemd/units/blfs/units/sshd.socket branches/systemd/units/blfs/units/sshdat.service branches/systemd/units/blfs/units/svnserve.service branches/systemd/units/blfs/units/swat.socket branches/systemd/units/blfs/units/swatat.service branches/systemd/units/blfs/units/tor.service branches/systemd/units/blfs/units/winbindd.service Modified: branches/systemd/general.ent branches/systemd/introduction/important/bootscripts.xml Modified: branches/systemd/general.ent ============================================================================== --- branches/systemd/general.ent Mon Jun 10 14:05:15 2013 (r11283) +++ branches/systemd/general.ent Mon Jun 10 14:51:18 2013 (r11284) @@ -3,13 +3,13 @@ $Date$ --> -<!ENTITY day "05"> <!-- Always 2 digits --> +<!ENTITY day "10"> <!-- Always 2 digits --> <!ENTITY month "06"> <!-- Always 2 digits --> <!ENTITY year "2013"> <!ENTITY copyrightdate "2001-&year;"> <!ENTITY copyholder "The BLFS Development Team"> <!ENTITY version "systemd version &year;-&month;-&day;"> -<!ENTITY releasedate "June 1st, &year;"> +<!ENTITY releasedate "June 10th, &year;"> <!ENTITY pubdate "&year;-&month;-&day;"> <!-- metadata req. by TLDP --> <!ENTITY blfs-version "svn"> <!-- svn|[release #] --> <!ENTITY lfs-version "development"> <!-- version|testing|unstable|development] --> @@ -68,8 +68,8 @@ <!ENTITY lfs-vim-version "7.3"> <!-- End LFS versions --> -<!ENTITY blfs-bootscripts-version "20130512"> -<!ENTITY blfs-bootscripts-download "&downloads-root;/blfs-bootscripts-&blfs-bootscripts-version;.tar.bz2"> +<!ENTITY blfs-units-version "20130512"> +<!ENTITY blfs-units-download "&downloads-root;/blfs-units-&blfs-units-version;.tar.bz2"> <!ENTITY blfs-wiki "http://wiki.&lfs-domainname;/blfs/wiki"> Modified: branches/systemd/introduction/important/bootscripts.xml ============================================================================== --- branches/systemd/introduction/important/bootscripts.xml Mon Jun 10 14:05:15 2013 (r11283) +++ branches/systemd/introduction/important/bootscripts.xml Mon Jun 10 14:51:18 2013 (r11284) @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="bootscripts" xreflabel="blfs-bootscripts-&blfs-bootscripts-version;"> +<sect1 id="bootscripts" xreflabel="blfs-units-&blfs-units-version;"> <?dbhtml filename="bootscripts.html"?> <sect1info> @@ -13,45 +13,34 @@ <date>$Date$</date> </sect1info> - <title>BLFS Boot Scripts</title> + <title>BLFS Units</title> <indexterm zone="bootscripts"> - <primary sortas="a-BLFS-Bootscripts">BLFS Bootscripts</primary> + <primary sortas="a-BLFS-Units">BLFS Units</primary> </indexterm> <indexterm zone="bootscripts"> <primary sortas="f-AA-General-Information">General Information</primary> </indexterm> - <para>The BLFS Bootscripts package contains the init - scripts that are used throughout the book. It is assumed that you will be - using the BLFS Bootscripts package in conjunction with a compatible - LFS-Bootscripts package. Refer to - <ulink url="&lfs-root;/chapter07/bootscripts.html"/> for more - information on the LFS-Bootscripts package.</para> + <para>The BLFS Units package contains the Systemd units that are + used throughout the book.</para> - <itemizedlist spacing='compact'> + <itemizedlist spacing="compact"> <title>Package Information</title> <listitem> - <para>Download: <ulink url="&blfs-bootscripts-download;"/></para> + <para>Download: <ulink url="&blfs-units-download;"/></para> </listitem> </itemizedlist> - <para>The BLFS Bootscripts package will be used throughout the BLFS book - for startup scripts. Unlike LFS, each init script has a separate install target - in the BLFS Bootscripts package. It is recommended you keep the package source - directory around until completion of your BLFS system. When a script is - requested from BLFS Bootscripts, simply change to the directory and as the + <para>The BLFS Units package will be used throughout the BLFS book + for Systemd units. Each unit has a separate install target + in the BLFS Units package. It is recommended you keep the package source + directory around until completion of your BLFS system. When a unit is + requested from BLFS Units, simply change to the directory and as the <systemitem class="username">root</systemitem> user, execute the given - <command>make install-<replaceable><init-script></replaceable></command> - command. This command installs the init script to its proper location (along - with any auxiliary configuration scripts) and also creates the appropriate - symlinks to start and stop the service at the appropriate run-level.</para> - - <note> - <para>It is advisable to peruse each bootscript before installation to - ascertain that it satisfies your need. Also verify that the start and stop - symlinks it creates match your preferences.</para> - </note> + <command>make install-<replaceable><unit></replaceable></command> + command. This command installs the Systemd unit to its proper location + (along with any auxiliary configuration scripts).</para> </sect1> Added: branches/systemd/units/ChangeLog ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/ChangeLog Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,3 @@ +2013-06-10 Armin K. <[email protected]> + * Import first revision of the standalone + units package. Added: branches/systemd/units/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/LICENSE Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,29 @@ +Copyright (c) 1999-2002, Gerard Beekmans + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions in any form must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Neither the name of "Linux From Scratch" nor the names of its + contributors may be used to endorse or promote products derived from + this material without specific prior written permission. + + * Any material derived from Linux From Scratch must contain a + reference to the "Linux From Scratch" project. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS +IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + Added: branches/systemd/units/MAINTAINERS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/MAINTAINERS Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,2 @@ +This package is maintained by the BLFS Systemd BOOK Editors. +See <http://www.linuxfromscratch.org/blfs/>. Added: branches/systemd/units/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/README Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,12 @@ +blfs-units: + +This package contains the Systemd units that are mentioned +in the BLFS Systemd BOOK. + +The various install targets are mentioned in the BLFS +Systemd book. There are variables defined for script +permissions {MODE}, configuration and units file +permissions {CONFMODE}, directory permissions {DIRMODE} +and destination directory {DESTDIR}. For more information +refer to the BLFS Systemd BOOK at +http://www.linuxfromscratch.org/blfs/ . Added: branches/systemd/units/blfs/default/dhcpd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/default/dhcpd Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,12 @@ +# Begin /etc/default/dhcpd + +# On which interfaces should the DHCP Server (dhcpd) serve DHCP requests +# Separate multiple interfaces with spaces, e.g. "eth0 eth1". +# By default, dhcpd will listen on all available interfaces. In that +# case, use -4 or -6 in the DHCPD_OPTS below to listen on IPv4 or IPv6 +DHCPD_INTERFACES="" + +# Additional options that you want to pass to the DHCP Server Daemon +DHCPD_OPTS="" + +# End /etc/default/dhcpd Added: branches/systemd/units/blfs/default/samba ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/default/samba Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,5 @@ +# Additional options to pass to nmbd command line +NMBD_OPTS= + +# Additional options to pass to smbd command line +SMBD_OPTS= Added: branches/systemd/units/blfs/default/saslauthd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/default/saslauthd Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,36 @@ +# Begin /etc/default/saslauthd + +# Which authentication mechanisms should saslauthd use? (default: pam) +# +# Available options in this package: +# getpwent -- use the getpwent() library function +# kerberos5 -- use Kerberos 5 +# pam -- use PAM +# rimap -- use a remote IMAP server +# shadow -- use the local shadow password file +# sasldb -- use the local sasldb database file +# ldap -- use LDAP (configuration is in /etc/saslauthd.conf) +# +# Only one option may be used at a time. See the saslauthd man page +# for more information. +# +# Example: MECHANISMS="shadow" +MECHANISMS="shadow" + +# Additional options for this mechanism. (default: none) +# See the saslauthd man page for information about mech-specific options. +# Note: Specify "-O options" in the following variable or saslauthd will fail. +MECH_OPTIONS="" + +# How many saslauthd processes should we run? (default: 5) +# A value of 0 will fork a new process for each connection. +THREADS=5 + +# Other options (default: -c -m /var/run/saslauthd) +# Note: You MUST specify the -m option or saslauthd won't run! +# +# See the saslauthd man page and the output of 'saslauthd -h' for general +# information about these options. +SASLAUTHD_OPTS="-c -m /var/run/saslauthd" + +# End /etc/default/saslauthd Added: branches/systemd/units/blfs/default/slapd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/default/slapd Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,17 @@ +# Begin /etc/default/slapd + +# slapd normally serves ldap only on all TCP-ports 389. slapd can also +# service requests on TCP-port 636 (ldaps) and requests via unix +# sockets. +# Example usage: +#SLAPD_SERVICES="ldap://127.0.0.1:389/ ldaps:/// ldapi:///" + +# Add any aditional options you want to pass to slapd command line. +# +# Use "-h $SLAPD_SERVICES" in the SLAPD_OPTS below if you have +# uncommented and modified SLAPD_SERVICES line above. +# +# See man 8 slapd for more information. +SLAPD_OPTS="" + +# End /etc/default/slapd Added: branches/systemd/units/blfs/default/svnserve ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/default/svnserve Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,8 @@ +# Begin /etc/default/svnserve + +# Additional options to pass to svnserve command line +# +# Example: -r /srv/svn/repositories +SVNSERVE_OPTS="" + +# End /etc/default/svnserve Added: branches/systemd/units/blfs/default/winbindd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/default/winbindd Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,2 @@ +# Additional options to pass to winbindd command line +WINBINDD_OPTS= Added: branches/systemd/units/blfs/services/bridge ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/services/bridge Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,76 @@ +#!/bin/sh +######################################################################## +# Begin /lib/services/bridge +# +# Description : Bridge Boot Script +# +# Authors : Nathan Coulson - [email protected] +# Bruce Dubbs - [email protected] +# +# Version : LFS-7.2 +# +######################################################################## + +. /lib/lsb/init-functions +. ${IFCONFIG} + +# Make compatible with older versions of init-functions +unset is_true + +is_true() +{ + [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] || + [ "$1" = "y" ] || [ "$1" = "t" ] +} + +if [ -z "${INTERFACE_COMPONENTS}" ]; then + log_failure_msg "INTERFACE_COMPONENTS variable missing from ${IFCONFIG}" + exit 1 +fi + +case "${2}" in + up) + log_info_msg2 "\n" + log_info_msg "Creating the ${1} interface..." + brctl addbr ${1} + evaluate_retval + + for I in ${INTERFACE_COMPONENTS}; do + log_info_msg "Adding ${I} to ${1}..." + brctl addif ${1} ${I} + evaluate_retval + done + + if is_true ${STP}; then + brctl stp ${1} on + log_success_msg "Setting spanning tree protocol" + fi + + if is_true ${IP_FORWARD}; then + sysctl -w net.ipv4.ip_forward=1 > /dev/null + log_success_msg "Setting net.ipv4.ip_forward = 1" + fi + ;; + + down) + for I in ${INTERFACE_COMPONENTS}; do + log_info_msg "Removing ${I} from ${1}..." + ip link set ${I} down && + brctl delif ${1} ${I} + evaluate_retval + done + + log_info_msg "Bringing down the ${1} interface..." + ip link set ${1} down + brctl delbr ${1} + evaluate_retval + ;; + + *) + echo "Usage: ${0} [interface] {up|down}" + exit 1 + ;; +esac + +# End /lib/services/bridge + Added: branches/systemd/units/blfs/services/dhclient ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/services/dhclient Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,117 @@ +#!/bin/sh +# Begin services/dhclient + +# Origianlly based upon lfs-bootscripts-1.12 $NETWORK_DEVICES/if{down,up} +# Rewritten by Nathan Coulson <[email protected]> +# Adapted for dhclient by DJ Lucas <[email protected]> +# Update for LFS 7.0 by Ken Moffat <[email protected]> + +# Call with: IFCONFIG=<filename> /lib/services/dhclient <IFACE> <up | down> + +#$LastChangedBy: krejzi $ +#$Date: 2013-02-11 17:22:35 +0100 (Mon, 11 Feb 2013) $ + +. /lib/lsb/init-functions +. $IFCONFIG + +PIDFILE=/run/dhclient-$1.pid +LFILE=/var/lib/dhclient/dhclient-$1.leases + +getipstats() +{ + # Print the last 16 lines of dhclient.leases + sed -e :a -e '$q;N;17,$D;ba' ${LFILE} +} + +# Make compatible with older versions of init-functions +unset is_true + +is_true() +{ + [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] || + [ "$1" = "y" ] || [ "$1" = "t" ] +} + +case "$2" in + up) + + if [ -e ${PIDFILE} ]; then + ps $(cat ${PIDFILE}) | grep dhclient >/dev/null + if [ "$?" = "0" ]; then + log_warning_msg "\n dhclient appears to be running on $1" + exit 0 + else + rm ${PIDFILE} + fi + fi + + log_info_msg "\n Starting dhclient on the $1 interface..." + + /sbin/dhclient -lf ${LFILE} -pf ${PIDFILE} $DHCP_START $1 + + if [ "$?" != "0" ]; then + log_failure_msg2 + exit 1 + fi + + # Print the assigned settings if requested + if is_true "$PRINTIP" -o is_true "$PRINTALL"; then + # Get info from dhclient.leases file + + IPADDR=`getipstats | grep "fixed-address" | \ + sed 's/ fixed-address //' | \ + sed 's/\;//'` + + NETMASK=`getipstats | grep "subnet-mask" | \ + sed 's/ option subnet-mask //' | \ + sed 's/\;//'` + + GATEWAY=`getipstats | grep "routers" | \ + sed 's/ option routers //' | \ + sed 's/\;//'` + + DNS=`getipstats | grep "domain-name-servers" | \ + sed 's/ option domain-name-servers //' | \ + sed 's/\;//' | sed 's/,/ and /'` + + if [ "$PRINTALL" = "yes" ]; then + # This is messy, the messages are on one very long + # line on the screen and in the log + log_info_msg " DHCP Assigned Settings for $1:" + log_info_msg " IP Address: $IPADDR" + log_info_msg " Subnet Mask: $NETMASK" + log_info_msg " Default Gateway: $GATEWAY" + log_info_msg " DNS Server: $DNS" + else + log_info_msg " IP Addresss:""$IPADDR" + fi + fi + + log_success_msg2 + ;; + + down) + if [ ! -e ${PIDFILE} ]; then + log_warning_msg "\n dhclient doesn't appear to be running on $1" + exit 0 + fi + + log_info_msg "\n Stopping dhclient on the $1 interface..." + + /sbin/dhclient -r -lf ${LFILE} -pf ${PIDFILE} $DHCP_STOP $1 + + ps $(cat ${PIDFILE}) | grep dhclient >/dev/null + if [ "$?" != "0" ]; then + rm -f ${PIDFILE} + fi + + evaluate_retval + ;; + + *) + echo "Usage: $0 [interface] {up|down}" + exit 1 + ;; +esac + +# End services/dhclient Added: branches/systemd/units/blfs/services/dhcpcd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/services/dhcpcd Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,69 @@ +#!/bin/bash +# Begin services/dhcpcd + +# Origianlly dased upon lfs-bootscripts-1.12 $NETWORK_DEVICES/if{down,up} +# Rewritten by Nathan Coulson <[email protected]> +# Adapted for dhcpcd by DJ Lucas <[email protected]> +# Update for LFS 7.0 by Bruce Dubbs <bdubbs@linuxfromscratch,org> + +# Call with: IFCONFIG=<filename> /lib/services/dhcpcd <IFACE> <up | down> + +#$LastChangedBy: bdubbs $ +#$Date: 2012-04-09 21:48:51 +0200 (Mon, 09 Apr 2012) $ + +. /lib/lsb/init-functions +. $IFCONFIG + +pidfile="/var/run/dhcpcd-$1.pid" + +case "$2" in + up) + # Cosmetic output not needed for multiple services + if ! $(echo ${SERVICE} | grep -q " "); then + log_info_msg2 "\n" # Terminate the previous message + fi + + log_info_msg "Starting dhcpcd on the $1 interface..." + + # Test to see if there is a stale pid file + if [ -f "$pidfile" ]; then + ps `cat "$pidfile"` | grep dhcpcd > /dev/null + + if [ $? != 0 ]; then + rm -f /var/run/dhcpcd-$1.pid > /dev/null + + else + log_warning_msg "dhcpcd is already running!" + exit 2 + fi + fi + + /sbin/dhcpcd $1 $DHCP_START + evaluate_retval + ;; + + down) + log_info_msg "Stopping dhcpcd on the $1 interface..." + + if [ -z "$DHCP_STOP" ]; then + killproc -p "${pidfile}" /sbin/dhcpcd + + else + /sbin/dhcpcd $1 $DHCP_STOP &> /dev/null + + if [ "$?" -eq 1 ]; then + log_warning_msg "dhcpcd not running!" + exit 2 + fi + fi + + evaluate_retval + ;; + + *) + echo "Usage: $0 [interface] {up|down}" + exit 1 + ;; +esac + +# End services/dhcpcd Added: branches/systemd/units/blfs/services/wpa ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/services/wpa Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,89 @@ +#!/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: krejzi $ +#$Date: 2013-03-24 16:39:14 +0100 (Sun, 24 Mar 2013) $ + +. /lib/lsb/init-functions +. $IFCONFIG + +CFGFILE=/etc/sysconfig/wpa_supplicant-${IFCONFIG##*.}.conf +PIDFILE=/run/wpa_supplicant/$1.pid +CONTROL_IFACE=/run/wpa_supplicant/$1 + +case "$2" in + up) + + if [ -e ${PIDFILE} ]; then + ps $(cat ${PIDFILE}) | grep wpa_supplicant >/dev/null + if [ "$?" = "0" ]; then + log_warning_msg "\n wpa_supplicant already running on $1." + exit 0 + else + rm ${PIDFILE} + fi + fi + + if [ ! -e ${CFGFILE} ]; then + log_info_msg "\n wpa_supplicant configuration file ${CFGFILE} 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${PIDFILE} -C/run/wpa_supplicant -c${CFGFILE} -i$1 ${WPA_ARGS} + + 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 ${PIDFILE} ]; then + kill -9 $(cat ${PIDFILE}) + rm -f ${PIDFILE} ${CONTROL_IFACE} + 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 Added: branches/systemd/units/blfs/tmpfiles/httpd.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/tmpfiles/httpd.conf Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1 @@ +d /run/httpd 755 root root - Added: branches/systemd/units/blfs/tmpfiles/mysqld.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/tmpfiles/mysqld.conf Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1 @@ +d /run/mysqld 0755 mysql mysql - Added: branches/systemd/units/blfs/tmpfiles/named.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/tmpfiles/named.conf Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1 @@ +d /run/named 0750 named named - Added: branches/systemd/units/blfs/tmpfiles/nscd.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/tmpfiles/nscd.conf Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,2 @@ +d /run/nscd 755 root root - + Added: branches/systemd/units/blfs/tmpfiles/postgresql.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/tmpfiles/postgresql.conf Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1 @@ +d /run/postgresql 0775 postgres postgres - Added: branches/systemd/units/blfs/tmpfiles/samba.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/tmpfiles/samba.conf Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1 @@ +d /run/samba 755 root root - Added: branches/systemd/units/blfs/tmpfiles/saslauthd.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/tmpfiles/saslauthd.conf Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1 @@ +d /run/saslauthd 755 root root - Added: branches/systemd/units/blfs/tmpfiles/slapd.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/tmpfiles/slapd.conf Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1 @@ +d /run/openldap 0755 ldap ldap - Added: branches/systemd/units/blfs/tmpfiles/sshd.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/tmpfiles/sshd.conf Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1 @@ +d /run/sshd 755 root root - Added: branches/systemd/units/blfs/tmpfiles/svnserve.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/tmpfiles/svnserve.conf Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1 @@ +d /run/svnserve 0700 root root - Added: branches/systemd/units/blfs/units/acpid.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/acpid.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,7 @@ +[Unit] +Description=ACPI event daemon +Requires=acpid.socket + +[Service] +StandardInput=socket +ExecStart=/usr/sbin/acpid Added: branches/systemd/units/blfs/units/acpid.socket ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/acpid.socket Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,8 @@ +[Unit] +Description=ACPID Listen Socket + +[Socket] +ListenStream=/run/acpid.socket + +[Install] +WantedBy=sockets.target Added: branches/systemd/units/blfs/units/dhcpd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/dhcpd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,13 @@ +[Unit] +Description=ISC DHCP Server +After=network.target + +[Service] +Type=forking +PIDFile=/run/dhcpd.pid +EnvironmentFile=/etc/default/dhcpd +ExecStart=/usr/sbin/dhcpd -pf /run/dhcpd.pid -q $DHCPD_OPTS $DHCPD_INTERFACES +KillSignal=SIGINT + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/httpd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/httpd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,15 @@ +[Unit] +Description=Apache Web Server +After=network.target remote-fs.target nss-lookup.target + +[Service] +Type=forking +PIDFile=/run/httpd/httpd.pid +ExecStart=/usr/sbin/apachectl start +ExecStop=/usr/sbin/apachectl graceful-stop +ExecReload=/usr/sbin/apachectl graceful +PrivateTmp=true +LimitNOFILE=infinity + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/kdm.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/kdm.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,9 @@ +[Unit] +Description=K Display Manager +After=systemd-user-sessions.service + +[Service] +ExecStart=/usr/bin/kdm -nodaemon + +[Install] +Alias=display-manager.service Added: branches/systemd/units/blfs/units/krb5-kadmind.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/krb5-kadmind.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,8 @@ +[Unit] +Description=Kerberos 5 Administration Server + +[Service] +ExecStart=/usr/sbin/kadmind -nofork + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/krb5-kdc.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/krb5-kdc.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,9 @@ +[Unit] +Description=Kerberos 5 KDC + +[Service] +ExecStart=/usr/sbin/krb5kdc -n +Restart=always + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/krb5-kpropd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/krb5-kpropd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,8 @@ +[Unit] +Description=Kerberos 5 Propagation Server + +[Service] +ExecStart=/usr/sbin/kpropd -S + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/mysqld.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/mysqld.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,13 @@ +[Unit] +Description=MySQL Server +After=network.target + +[Service] +User=mysql +Group=mysql +ExecStart=/usr/sbin/mysqld --pid-file=/run/mysqld/mysqld.pid +Restart=always +PrivateTmp=true + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/named.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/named.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,11 @@ +[Unit] +Description=Internet domain name server +After=network.target + +[Service] +ExecStart=/usr/sbin/named -f -u named +ExecReload=/usr/sbin/rndc reload +ExecStop=/usr/sbin/rndc stop + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/nmbd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/nmbd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,13 @@ +[Unit] +Description=Samba NetBIOS name server +After=network.target + +[Service] +Type=forking +EnvironmentFile=/etc/default/samba +PIDFile=/run/samba/nmbd.pid +ExecStart=/usr/sbin/nmbd -D $NMBD_OPTS +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/nscd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/nscd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,16 @@ +[Unit] +Description=Name Service Cache Daemon + +[Service] +Type=forking +ExecStart=/usr/sbin/nscd +ExecStop=/usr/sbin/nscd --shutdown +ExecReload=/usr/sbin/nscd -i passwd +ExecReload=/usr/sbin/nscd -i group +ExecReload=/usr/sbin/nscd -i hosts +ExecReload=/usr/sbin/nscd -i services +Restart=always +PIDFile=/run/nscd/nscd.pid + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/ntpd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/ntpd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,13 @@ +[Unit] +Description=Network Time Protocol daemon +After=network.target nss-lookup.target + +[Service] +Type=forking +PrivateTmp=true +ExecStart=/usr/sbin/ntpd -g -u ntp:ntp +ControlGroup=cpu:/ + +[Install] +WantedBy=multi-user.target + Added: branches/systemd/units/blfs/units/postfix.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/postfix.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,14 @@ +[Unit] +Description=Postfix Mail Transport Agent +After=network.target + +[Service] +Type=forking +PIDFile=/var/spool/postfix/pid/master.pid +ExecStart=/usr/sbin/postfix start +ExecStop=/usr/sbin/postfix stop +ExecReload=/usr/sbin/postfix reload +Restart=always + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/postgresql.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/postgresql.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,25 @@ +[Unit] +Description=PostgreSQL database server +After=network.target + +[Service] +Type=forking +TimeoutSec=120 +User=postgres +Group=postgres + +Environment=PGROOT=/srv/pgsql + +SyslogIdentifier=postgres +PIDFile=${PGROOT}/data/postmaster.pid + +ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120 +ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT}/data reload +ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast + +# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in +# killing Postgres, so adjust it downward +OOMScoreAdjust=-200 + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/saslauthd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/saslauthd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,11 @@ +[Unit] +Description=Cyrus SASL authentication daemon + +[Service] +Type=forking +EnvironmentFile=/etc/default/saslauthd +ExecStart=/usr/sbin/saslauthd -a $MECHANISMS -n $THREADS $MECH_OPTIONS $SASLAUTHD_OPTS +PidFile=/run/saslauthd/saslauthd.pid + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/slapd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/slapd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,11 @@ +[Unit] +Description=OpenLDAP server daemon +After=network.target + +[Service] +Type=forking +EnvironmentFile=/etc/default/slapd +ExecStart=/usr/sbin/slapd -u ldap -g ldap $SLAPD_OPTS + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/smbd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/smbd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,13 @@ +[Unit] +Description=Samba SMB/CIFS server +After=network.target nmbd.service winbindd.service + +[Service] +Type=forking +EnvironmentFile=/etc/default/samba +PIDFile=/run/samba/smbd.pid +ExecStart=/usr/sbin/smbd -D $SMBD_OPTS +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/smbd.socket ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/smbd.socket Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,9 @@ +[Unit] +Description=Samba SMB/CIFS server socket + +[Socket] +ListenStream=445 +Accept=yes + +[Install] +WantedBy=sockets.target Added: branches/systemd/units/blfs/units/smbdat.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/smbdat.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,10 @@ +[Unit] +Description=Samba SMB/CIFS server instance + +[Service] +Type=forking +EnvironmentFile=/etc/default/samba +PIDFile=/run/samba/smbd.pid +ExecStart=/usr/sbin/smbd -F $SMBD_OPTS +ExecReload=/bin/kill -HUP $MAINPID +StandardInput=socket Added: branches/systemd/units/blfs/units/sshd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/sshd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,11 @@ +[Unit] +Description=OpenSSH Daemon + +[Service] +ExecStart=/usr/sbin/sshd -D +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +Restart=always + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/sshd.socket ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/sshd.socket Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,9 @@ +[Unit] +Conflicts=sshd.service + +[Socket] +ListenStream=22 +Accept=yes + +[Install] +WantedBy=sockets.target Added: branches/systemd/units/blfs/units/sshdat.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/sshdat.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,7 @@ +[Unit] +Description=SSH Per-Connection Server + +[Service] +ExecStart=/usr/sbin/sshd -i +StandardInput=socket +StandardError=syslog Added: branches/systemd/units/blfs/units/svnserve.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/svnserve.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,11 @@ +[Unit] +Description=Subversion protocol daemon +After=network.target + +[Service] +Type=forking +EnvironmentFile=/etc/default/svnserve +ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid $SVNSERVE_OPTS + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/swat.socket ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/swat.socket Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,9 @@ +[Unit] +Description=SWAT Samba Web Admin Tool + +[Socket] +ListenStream=127.0.0.1:901 +Accept=true + +[Install] +WantedBy=sockets.target Added: branches/systemd/units/blfs/units/swatat.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/swatat.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,7 @@ +[Unit] +Description=SWAT Samba Web Admin Tool +After=local-fs.target + +[Service] +ExecStart=/usr/sbin/swat +StandardInput=socket Added: branches/systemd/units/blfs/units/tor.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/tor.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,12 @@ +[Unit] +Description=Anonymizing Overlay Network +After=network.target + +[Service] +Type=forking +ExecStart=/usr/bin/tor +ExecReload=/bin/kill -HUP $MAINPID +KillSignal=SIGINT + +[Install] +WantedBy=multi-user.target Added: branches/systemd/units/blfs/units/winbindd.service ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/systemd/units/blfs/units/winbindd.service Mon Jun 10 14:51:18 2013 (r11284) @@ -0,0 +1,13 @@ +[Unit] +Description=Samba Winbind daemon +After=network.target nmbd.service + +[Service] +Type=forking +EnvironmentFile=/etc/default/samba +PIDFile=/run/samba/winbindd.pid +ExecStart=/usr/sbin/winbindd -D $WINBINDD_OPTS +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target -- http://linuxfromscratch.org/mailman/listinfo/blfs-book FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
