├── .gitignore ├── conf.d ├── termencoding ├── atd ├── net-auto-wireless ├── sshd ├── bitlbee ├── ntpd ├── transmissiond ├── rpcbind ├── dcron ├── acpid ├── syslog-ng ├── alsa └── udev ├── init.d ├── cupsd.in ├── bluetooth.in ├── atd.in ├── ufw.in ├── bitlbee.in ├── mpd.in ├── net-auto-wireless.in ├── login.in ├── cronie.in ├── ntpd.in ├── transmissiond.in ├── dhcpcd.in ├── sshd.in ├── rpcbind.in ├── acpid.in ├── dcron.in ├── networkmanager.in ├── dbus.in ├── fcron.in ├── syslog-ng.in ├── alsa.in ├── udev-mount.in └── udev.in ├── README.rst ├── Makefile └── COPYING-GPLv2 /.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /conf.d/termencoding: -------------------------------------------------------------------------------- 1 | UNICODE=1 2 | -------------------------------------------------------------------------------- /conf.d/atd: -------------------------------------------------------------------------------- 1 | # atd options (see atd(8)) 2 | ATD_OPTS='' 3 | -------------------------------------------------------------------------------- /conf.d/net-auto-wireless: -------------------------------------------------------------------------------- 1 | # net-auto-wireless 2 | IFACE=wlan0 3 | -------------------------------------------------------------------------------- /conf.d/sshd: -------------------------------------------------------------------------------- 1 | # additional sshd options; see sshd(8) 2 | #SSHD_OPTS="" 3 | -------------------------------------------------------------------------------- /conf.d/bitlbee: -------------------------------------------------------------------------------- 1 | # bitlbee options (see bitlbee -h) 2 | BITLBEE_OPTS="-F" 3 | -------------------------------------------------------------------------------- /conf.d/ntpd: -------------------------------------------------------------------------------- 1 | # ntpd options (see ntpd(1)) 2 | NTPD_OPTS="-g -u ntp:ntp" 3 | -------------------------------------------------------------------------------- /conf.d/transmissiond: -------------------------------------------------------------------------------- 1 | #TRANSMISSION_ARGS="-c /home/user/torrents" 2 | #TRANSMISSION_USER= 3 | -------------------------------------------------------------------------------- /conf.d/rpcbind: -------------------------------------------------------------------------------- 1 | # /etc/conf.d/rpcbind 2 | 3 | # Options for `rpcbind`. 4 | #RPCBIND_OPTS="-l" 5 | -------------------------------------------------------------------------------- /init.d/cupsd.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | command="/usr/sbin/cupsd" 4 | 5 | depend() { 6 | use logger 7 | } 8 | -------------------------------------------------------------------------------- /conf.d/dcron: -------------------------------------------------------------------------------- 1 | # /etc/conf.d/dcron 2 | 3 | # Options to pass to dcron at startup. 4 | # Default logging is via syslog; use -L to send to file. 5 | DCRON_OPTS="" 6 | -------------------------------------------------------------------------------- /init.d/bluetooth.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | command=/usr/sbin/bluetoothd 4 | 5 | depend() { 6 | after coldplug 7 | need dbus localmount hostname 8 | } 9 | -------------------------------------------------------------------------------- /init.d/atd.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | pidfile=/run/atd.pid 4 | command=/usr/sbin/atd 5 | command_args="$ATD_OPTS" 6 | 7 | depend() { 8 | need clock logger 9 | } 10 | -------------------------------------------------------------------------------- /conf.d/acpid: -------------------------------------------------------------------------------- 1 | # /etc/conf.d/acpid: config file for /etc/init.d/acpid 2 | 3 | # Options to pass to the acpid daemon. 4 | # See the acpid(8) man page for more info. 5 | 6 | ACPID_ARGS="" 7 | -------------------------------------------------------------------------------- /conf.d/syslog-ng: -------------------------------------------------------------------------------- 1 | # Config file for /etc/init.d/syslog-ng 2 | 3 | # Put any additional options for syslog-ng here. 4 | # See syslog-ng(8) for more information. 5 | 6 | SYSLOG_NG_OPTS="" 7 | -------------------------------------------------------------------------------- /init.d/ufw.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | depend() { 4 | before net 5 | provide firewall 6 | } 7 | 8 | start() { 9 | /usr/lib/ufw/ufw-init start &> /dev/null & 10 | } 11 | 12 | stop() { 13 | /usr/lib/ufw/ufw-init stop 14 | } 15 | -------------------------------------------------------------------------------- /init.d/bitlbee.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | description="Brings instant messaging (XMPP, MSN, Yahoo!, AIM, ICQ, Twitter) to IRC" 4 | pidfile=/run/bitlbee/bitlbee.pid 5 | command=bitlbee 6 | command_args="$BITLBEE_OPTS" 7 | 8 | depend() { 9 | need logger net 10 | } 11 | -------------------------------------------------------------------------------- /init.d/mpd.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | command="/usr/bin/mpd" 4 | description="Music Player Daemon" 5 | 6 | depend() 7 | { 8 | need localmount 9 | use net 10 | } 11 | 12 | stop() { 13 | ebegin "Stopping mpd" 14 | $command --kill 15 | eend $? 16 | } 17 | -------------------------------------------------------------------------------- /init.d/net-auto-wireless.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | depend() 4 | { 5 | need localmount 6 | after bootmisc 7 | use logger 8 | provide net 9 | } 10 | 11 | start() { 12 | /usr/bin/netcfg-wpa_actiond $IFACE 13 | } 14 | 15 | stop() { 16 | /usr/bin/netcfg-wpa_actiond stop $IFACE 17 | } 18 | -------------------------------------------------------------------------------- /init.d/login.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | description="Remove /run/nologin created by systemd tmpfiles.d" 4 | 5 | depend() { 6 | after tmpfilesd.boot 7 | } 8 | 9 | start() { 10 | if [ -f /run/nologin ]; then 11 | rm -f /run/nologin 12 | return $? 13 | else 14 | return 0 15 | fi 16 | } 17 | -------------------------------------------------------------------------------- /init.d/cronie.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2012 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | 5 | command="/usr/sbin/crond" 6 | command_args="${CRONDARGS}" 7 | pidfile="/run/crond.pid" 8 | 9 | depend() { 10 | use clock logger 11 | need localmount 12 | provide cron 13 | } 14 | -------------------------------------------------------------------------------- /init.d/ntpd.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | command=/usr/bin/ntpd 4 | pidfile=/run/ntpd.pid 5 | command_args="$NTPD_OPTS" 6 | 7 | depend() { 8 | use net dns logger 9 | after ntp-client 10 | } 11 | 12 | start_pre() { 13 | if [ ! -f /etc/ntp.conf ]; then 14 | eerror "Missing /etc/ntp.conf" 15 | eerror "See ntpd.conf(5)" 16 | return 1 17 | fi 18 | return 0 19 | } 20 | -------------------------------------------------------------------------------- /init.d/transmissiond.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | name="transmissiond" 4 | description="Transmission daemon" 5 | command="/usr/bin/transmission-daemon" 6 | command_args="-f $TRANSMISSION_ARGS" 7 | command_background="yes" 8 | start_stop_daemon_args="--user ${TRANSMISSION_USER:-transmission}" 9 | pidfile="/run/$name.pid" 10 | 11 | depend() 12 | { 13 | need localmount 14 | use net 15 | } 16 | 17 | -------------------------------------------------------------------------------- /conf.d/alsa: -------------------------------------------------------------------------------- 1 | # RESTORE_ON_START: 2 | # Do you want to restore your mixer settings? If not, your cards will be 3 | # muted. 4 | # no - Do not restore state 5 | # yes - Restore state 6 | 7 | RESTORE_ON_START="yes" 8 | 9 | # SAVE_ON_STOP: 10 | # Do you want to save changes made to your mixer volumes when alsasound 11 | # stops? 12 | # no - Do not save state 13 | # yes - Save state 14 | 15 | SAVE_ON_STOP="yes" 16 | -------------------------------------------------------------------------------- /init.d/dhcpcd.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2011 Roy Marples 3 | # All rights reserved. Released under the 2-clause BSD license. 4 | 5 | command=/sbin/dhcpcd 6 | pidfile=/var/run/dhcpcd.pid 7 | command_args=-q 8 | name="DHCP Client Daemon" 9 | 10 | depend() 11 | { 12 | provide net 13 | need localmount 14 | use logger network 15 | after bootmisc modules 16 | before dns 17 | } 18 | -------------------------------------------------------------------------------- /init.d/sshd.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | command=/usr/bin/sshd 4 | description='ssh daemon' 5 | command_args="$SSHD_OPTS" 6 | pidfile=/run/sshd.pid 7 | required_files=/etc/ssh/sshd_config 8 | 9 | depend() { 10 | use logger dns 11 | need net 12 | } 13 | 14 | start_pre() { 15 | if [ -n "$SSHD_CONFDIR" -o -n "$SSHD_BINARY" -o -n "$SSHD_PIDFILE" ]; then 16 | ewarn "SSHD_CONFDIR, SSHD_BINARY, and SSHD_PIDFILE are no longer supported" 17 | fi 18 | /usr/bin/ssh-keygen -A 19 | } 20 | -------------------------------------------------------------------------------- /init.d/rpcbind.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2007 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | 5 | depend() { 6 | use net 7 | before inetd xinetd 8 | provide portmap 9 | } 10 | 11 | start() { 12 | ebegin "Starting rpcbind" 13 | start-stop-daemon --start --quiet --exec /usr/bin/rpcbind -- ${RPCBIND_OPTS} 14 | eend $? 15 | } 16 | 17 | stop() { 18 | ebegin "Stopping rpcbind" 19 | start-stop-daemon --stop --quiet --exec /usr/bin/rpcbind 20 | eend $? 21 | } 22 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | OpenRC Arch Services 2 | ==================== 3 | 4 | OpenRC service files for Arch Linux 5 | 6 | Contributing 7 | ------------ 8 | 9 | When submitting additional service files please: 10 | 11 | + verify that the service file actually works 12 | + include a conf file if necessary with sane defaults 13 | + make sure pid files are created in ``/run`` not ``/var/run`` 14 | + use 4 spaces for indentation 15 | + make a single commit per service 16 | 17 | See ``man runscript`` for details on writing service files. 18 | -------------------------------------------------------------------------------- /init.d/acpid.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2012 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | 5 | extra_started_commands="reload" 6 | command="/usr/bin/acpid" 7 | command_args="${ACPID_ARGS}" 8 | start_stop_daemon_args="--quiet" 9 | description="Daemon for Advanced Configuration and Power Interface" 10 | 11 | depend() { 12 | need localmount 13 | use logger 14 | } 15 | 16 | reload() { 17 | ebegin "Reloading acpid configuration" 18 | start-stop-daemon --exec $command --signal HUP 19 | eend $? 20 | } 21 | -------------------------------------------------------------------------------- /init.d/dcron.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2011 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | 5 | depend() { 6 | use logger clock hostname 7 | provide cron 8 | } 9 | 10 | start() { 11 | ebegin "Starting ${SVCNAME}" 12 | /usr/sbin/crond ${DCRON_OPTS} 13 | eend $? 14 | } 15 | 16 | stop() { 17 | ebegin "Stopping ${SVCNAME}" 18 | start-stop-daemon --stop --quiet \ 19 | --pidfile /run/crond.pid --exec /usr/sbin/crond 20 | local ret=$? 21 | rm -f /run/crond.pid 22 | eend ${ret} 23 | } 24 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | INPUT_FILES = ${wildcard init.d/*.in} 2 | INIT_FILES = ${INPUT_FILES:.in=} 3 | CONF_FILES = ${wildcard conf.d/*} 4 | 5 | PREFIX ?= /usr/local 6 | SYSCONFDIR ?= ${PREFIX}/etc 7 | SBINDIR ?= ${PREFIX}/sbin 8 | 9 | INITDIR = ${DESTDIR}/${SYSCONFDIR}/init.d 10 | CONFDIR = ${DESTDIR}/${SYSCONFDIR}/conf.d 11 | 12 | RUNSCRIPT ?= runscript 13 | 14 | all: ${INIT_FILES} ${CONF_FILES} 15 | 16 | %: %.in 17 | sed -e 's:@SBINDIR@:${SBINDIR}:g' $< > $@ 18 | sed -e 's:@RUNSCRIPT@:${SBINDIR}/${RUNSCRIPT}:g' $< > $@ 19 | 20 | install: ${INIT_FILES} 21 | install -d "${INITDIR}" "${CONFDIR}" 22 | install -m 755 -t "${INITDIR}" ${INIT_FILES} 23 | install -m 644 -t "${CONFDIR}" ${CONF_FILES} 24 | -------------------------------------------------------------------------------- /init.d/networkmanager.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | 3 | command=/usr/sbin/NetworkManager 4 | description="manages network connections" 5 | 6 | extra_started_commands="wake sleep" 7 | description_wake="" 8 | description_sleep="" 9 | 10 | depend() { 11 | need dbus 12 | } 13 | 14 | sleep() { 15 | /usr/bin/dbus-send --system \ 16 | --dest=org.freedesktop.NetworkManager \ 17 | --type=method_call \ 18 | /org/freedesktop/NetworkManager \ 19 | org.freedesktop.NetworkManager.sleep 20 | } 21 | 22 | wake() { 23 | /usr/bin/dbus-send --system \ 24 | --dest=org.freedesktop.NetworkManager \ 25 | --type=method_call \ 26 | /org/freedesktop/NetworkManager \ 27 | org.freedesktop.NetworkManager.wake 28 | } 29 | -------------------------------------------------------------------------------- /init.d/dbus.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2011 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License, v2 or later 4 | 5 | extra_started_commands="reload" 6 | 7 | depend() { 8 | need localmount 9 | after bootmisc 10 | } 11 | 12 | start() { 13 | ebegin "Starting D-BUS system messagebus" 14 | /usr/bin/dbus-uuidgen --ensure=/etc/machine-id 15 | 16 | # We need to test if /run/dbus exists, since script will fail if it does not 17 | [ ! -e /run/dbus ] && mkdir /run/dbus 18 | 19 | start-stop-daemon --start --pidfile /run/dbus/pid --exec /usr/bin/dbus-daemon -- --system 20 | eend $? 21 | } 22 | 23 | stop() { 24 | local retval 25 | 26 | ebegin "Stopping D-BUS system messagebus" 27 | 28 | start-stop-daemon --stop --pidfile /run/dbus/pid 29 | retval=$? 30 | 31 | eend ${retval} 32 | 33 | [ -S /run/dbus/system_bus_socket ] && rm -f /run/dbus/system_bus_socket 34 | 35 | return ${retval} 36 | } 37 | 38 | reload() { 39 | local retval 40 | 41 | ebegin "Reloading D-BUS messagebus config" 42 | 43 | /usr/bin/dbus-send --print-reply --system --type=method_call \ 44 | --dest=org.freedesktop.DBus \ 45 | / org.freedesktop.DBus.ReloadConfig > /dev/null 46 | retval=$? 47 | eend ${retval} 48 | return ${retval} 49 | } 50 | -------------------------------------------------------------------------------- /conf.d/udev: -------------------------------------------------------------------------------- 1 | # /etc/conf.d/udev: config file for udev 2 | 3 | # udev can trigger coldplug events which cause services to start and 4 | # kernel modules to be loaded. 5 | # Services are deferred to start in the boot runlevel. 6 | # Set rc_coldplug="NO" if you don't want this. 7 | # If you want module coldplugging but not coldplugging of services then you 8 | # can disable service coldplugging in baselayout/openrc config files. 9 | # The setting is named different in different versions. 10 | # in /etc/rc.conf: rc_hotplug="!*" or 11 | # in /etc/conf.d/rc: rc_plug_services="!*" 12 | #rc_coldplug="YES" 13 | 14 | # Expert options: 15 | 16 | # Timeout in seconds to wait for processing of uevents at boot. 17 | # There should be no need to change this. 18 | #udev_settle_timeout="60" 19 | 20 | # Add extra command line options to udevd, use with care 21 | # udevd --help for possible values 22 | #udev_opts="" 23 | 24 | # Run udevd --debug and write output to /run/udevdebug.log 25 | # Should not be kept on as it fills diskspace slowly 26 | #udev_debug="YES" 27 | 28 | # Run udevadmin monitor to get a log of all events 29 | # in /run/udevmonitor.log 30 | #udev_monitor="YES" 31 | 32 | # Keep udevmonitor running after populating /dev. 33 | #udev_monitor_keep_running="no" 34 | 35 | # Set cmdline options for udevmonitor. 36 | # could be some of --env --kernel --udev 37 | #udev_monitor_opts="--env" 38 | 39 | -------------------------------------------------------------------------------- /init.d/fcron.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2012 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | 5 | FCRON_INSTANCE=${SVCNAME##*.} 6 | 7 | configfile() { 8 | if [ -n "${FCRON_INSTANCE}" -a "${SVCNAME}" != "fcron" ]; then 9 | echo /etc/fcron/fcron.${FCRON_INSTANCE}.conf 10 | else 11 | echo /etc/fcron/fcron.conf 12 | fi 13 | } 14 | 15 | getconfig() { 16 | # if there is no configuration file return the default value 17 | if ! [ -f $(configfile) ]; then 18 | echo $2 19 | return 0 20 | fi 21 | 22 | sed -n -e 's:^$1[ \t]*=[ \t]*::p' $(configfile) 23 | } 24 | 25 | depend() { 26 | config $(configfile) 27 | 28 | use logger 29 | need clock hostname 30 | # provide the cron service if we are the main instance 31 | [ "${SVCNAME}" = "fcron" ] && provide cron 32 | } 33 | 34 | command="/usr/sbin/fcron" 35 | command_args="-c $(configfile)" 36 | pidfile=$(getconfig pidfile /run/fcron.pid) 37 | fcrontabs=$(getconfig fcrontabs /var/spool/fcron) 38 | 39 | extra_started_commands="reload" 40 | 41 | start_pre() { 42 | if [ ! -e $(configfile) ]; then 43 | eerror "You will need to create $(configfile) first" 44 | eerror "There is a sample in /etc/fcron" 45 | return 1 46 | fi 47 | 48 | if [ ! -d ${fcrontabs} ]; then 49 | ebegin "Creating missing spooldir ${fcrontabs}" 50 | ${command} --newspooldir ${fcrontabs} 51 | eend $? 52 | fi 53 | } 54 | 55 | reload() { 56 | kill -HUP `cat ${pidfile}` 57 | } 58 | 59 | -------------------------------------------------------------------------------- /init.d/syslog-ng.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2011 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | 5 | extra_commands="checkconfig" 6 | extra_started_commands="reload" 7 | 8 | depend() { 9 | # Make networking dependency conditional on configuration 10 | case $(sed 's/#.*//' /etc/syslog-ng/syslog-ng.conf) in 11 | *source*tcp*|*source*udp*|*destination*tcp*|*destination*udp*) 12 | need net 13 | use stunnel ;; 14 | esac 15 | 16 | config /etc/syslog-ng/syslog-ng.conf 17 | use clock 18 | need hostname localmount 19 | provide logger 20 | } 21 | 22 | checkconfig() { 23 | if [ ! -e /etc/syslog-ng/syslog-ng.conf ] ; then 24 | eerror "You need to create /etc/syslog-ng/syslog-ng.conf first." 25 | eerror "An example can be found in /etc/syslog-ng/syslog-ng.conf.sample" 26 | return 1 27 | fi 28 | syslog-ng -s -f /etc/syslog-ng/syslog-ng.conf 29 | 30 | # the start and reload functions have their own eends so 31 | # avoid calling this twice when there are no problems 32 | [ $? -eq 0 ] || eend $? "Configuration error. Please fix your configfile (/etc/syslog-ng/syslog-ng.conf)" 33 | } 34 | 35 | start() { 36 | checkconfig || return 1 37 | ebegin "Starting syslog-ng" 38 | [ -n "${SYSLOG_NG_OPTS}" ] && SYSLOG_NG_OPTS="-- ${SYSLOG_NG_OPTS}" 39 | start-stop-daemon --start --pidfile /run/syslog-ng.pid --exec /usr/bin/syslog-ng ${SYSLOG_NG_OPTS} 40 | eend $? "Failed to start syslog-ng" 41 | } 42 | 43 | stop() { 44 | ebegin "Stopping syslog-ng" 45 | start-stop-daemon --stop --pidfile /run/syslog-ng.pid 46 | eend $? "Failed to stop syslog-ng" 47 | sleep 1 # needed for syslog-ng to stop in case we're restarting 48 | } 49 | 50 | reload() { 51 | if [ ! -f /run/syslog-ng.pid ]; then 52 | eerror "syslog-ng isn't running" 53 | return 1 54 | fi 55 | checkconfig || return 1 56 | ebegin "Reloading configuration and re-opening log files" 57 | start-stop-daemon --signal HUP \ 58 | --pidfile /run/syslog-ng.pid 59 | eend $? 60 | } 61 | -------------------------------------------------------------------------------- /init.d/alsa.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2012 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | 5 | alsastatedir=/var/lib/alsa 6 | alsascrdir=/etc/alsa.d 7 | 8 | extra_commands="save restore" 9 | 10 | depend() { 11 | need localmount 12 | after bootmisc modules isapnp coldplug hotplug 13 | } 14 | 15 | restore() { 16 | ebegin "Restoring Mixer Levels" 17 | 18 | if [ ! -r "${alsastatedir}/asound.state" ] ; then 19 | ewarn "No mixer config in ${alsastatedir}/asound.state, you have to unmute your card!" 20 | eend 0 21 | return 0 22 | fi 23 | 24 | local cards="$(sed -n -e 's/ *\([[:digit:]]*\) .*/\1/p' /proc/asound/cards)" 25 | local CARDNUM 26 | for cardnum in ${cards}; do 27 | [ -e /dev/snd/controlC${cardnum} ] || sleep 2 28 | [ -e /dev/snd/controlC${cardnum} ] || sleep 2 29 | [ -e /dev/snd/controlC${cardnum} ] || sleep 2 30 | [ -e /dev/snd/controlC${cardnum} ] || sleep 2 31 | alsactl -I -f "${alsastatedir}/asound.state" restore ${cardnum} \ 32 | || ewarn "Errors while restoring defaults, ignoring" 33 | done 34 | 35 | for ossfile in "${alsastatedir}"/oss/card*_pcm* ; do 36 | [ -e "${ossfile}" ] || continue 37 | # We use cat because I'm not sure if cp works properly on /proc 38 | local procfile=${ossfile##${alsastatedir}/oss} 39 | procfile="$(echo "${procfile}" | sed -e 's,_,/,g')" 40 | if [ -e /proc/asound/"${procfile}"/oss ] ; then 41 | cat "${ossfile}" > /proc/asound/"${procfile}"/oss 42 | fi 43 | done 44 | 45 | eend 0 46 | } 47 | 48 | save() { 49 | ebegin "Storing ALSA Mixer Levels" 50 | 51 | mkdir -p "${alsastatedir}" 52 | if ! alsactl -f "${alsastatedir}/asound.state" store; then 53 | eerror "Error saving levels." 54 | eend 1 55 | return 1 56 | fi 57 | 58 | for ossfile in /proc/asound/card*/pcm*/oss; do 59 | [ -e "${ossfile}" ] || continue 60 | local device=${ossfile##/proc/asound/} ; device=${device%%/oss} 61 | device="$(echo "${device}" | sed -e 's,/,_,g')" 62 | mkdir -p "${alsastatedir}/oss/" 63 | cp "${ossfile}" "${alsastatedir}/oss/${device}" 64 | done 65 | 66 | eend 0 67 | } 68 | 69 | start() { 70 | if [ "${RESTORE_ON_START}" = "yes" ]; then 71 | restore 72 | fi 73 | 74 | return 0 75 | } 76 | 77 | stop() { 78 | if [ "${SAVE_ON_STOP}" = "yes" ]; then 79 | save 80 | fi 81 | return 0 82 | } 83 | -------------------------------------------------------------------------------- /init.d/udev-mount.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2010 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | 5 | description="mount devtmpfs on /dev" 6 | 7 | depend() 8 | { 9 | provide dev-mount 10 | keyword -vserver -lxc 11 | } 12 | 13 | mount_dev_directory() 14 | { 15 | local mounted=false fstab=false action=--mount msg=Mounting rc=0 16 | 17 | if ! grep -qs devtmpfs /proc/filesystems; then 18 | eerror "CONFIG_DEVTMPFS=y is required in your kernel configuration" 19 | eerror "for this version of udev to run successfully." 20 | eerror "This requires immediate attention." 21 | if ! mountinfo -q /dev; then 22 | mount -n -t tmpfs dev /dev 23 | busybox mdev -s 24 | mkdir /dev/pts 25 | fi 26 | return 1 27 | fi 28 | 29 | # Is /dev already a mounted devtmpfs? 30 | mountinfo -q -f devtmpfs /dev && mounted=true 31 | 32 | # If an entry for /dev exists in fstab it must be a devtmpfs. 33 | fstabinfo -q -t devtmpfs /dev && fstab=true 34 | 35 | # No options are processed here as they should all be in /etc/fstab 36 | if $fstab; then 37 | $mounted && action=--remount && msg=Remounting 38 | ebegin "$msg /dev according to /etc/fstab" 39 | fstabinfo $action /dev 40 | rc=$? 41 | elif ! $mounted; then 42 | ebegin "Mounting /dev" 43 | # Some devices require exec, Bug #92921 44 | mount -n -t devtmpfs -o "exec,nosuid,mode=0755,size=10M" udev /dev 45 | rc=$? 46 | else 47 | ebegin "Using /dev mounted from kernel" 48 | fi 49 | 50 | eend $rc 51 | } 52 | 53 | seed_dev() 54 | { 55 | # Seed /dev with some things that we know we need 56 | 57 | # creating /dev/console, /dev/tty and /dev/tty1 to be able to write 58 | # to $CONSOLE with/without bootsplash before udevd creates it 59 | [ -c /dev/console ] || mknod -m 600 /dev/console c 5 1 60 | [ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1 61 | [ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0 62 | 63 | # udevd will dup its stdin/stdout/stderr to /dev/null 64 | # and we do not want a file which gets buffered in ram 65 | [ -c /dev/null ] || mknod -m 666 /dev/null c 1 3 66 | 67 | # so udev can add its start-message to dmesg 68 | [ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11 69 | 70 | # Create problematic directories 71 | mkdir -p /dev/pts /dev/shm 72 | return 0 73 | } 74 | 75 | start() 76 | { 77 | mount_dev_directory || return 1 78 | 79 | seed_dev 80 | return 0 81 | } 82 | -------------------------------------------------------------------------------- /init.d/udev.in: -------------------------------------------------------------------------------- 1 | #!@RUNSCRIPT@ 2 | # Copyright 1999-2010 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | 5 | command=/usr/lib/systemd/systemd-udevd 6 | command_args="--daemon ${udev_opts}" 7 | description="udev manages device permissions and symbolic links in /dev" 8 | extra_started_commands="reload" 9 | description_reload="Reload the udev rules and databases" 10 | 11 | rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}} 12 | udev_debug="${udev_debug:-no}" 13 | udev_monitor="${udev_monitor:-no}" 14 | udev_monitor_keep_running="${udev_monitor_keep_running:-no}" 15 | udev_settle_timeout="${udev_settle_timeout:-60}" 16 | kv_min="${kv_min:-2.6.34}" 17 | 18 | depend() 19 | { 20 | # we depend on udev-mount explicitly, not dev-mount generic as we don't 21 | # want mdev as a dev-mount provider to come in. 22 | provide dev 23 | need sysfs udev-mount 24 | before checkfs fsck 25 | 26 | # udev does not work inside vservers 27 | keyword -vserver -lxc 28 | } 29 | 30 | KV_to_int() 31 | { 32 | [ -z $1 ] && return 1 33 | 34 | local x=${1%%[!0-9.]*} y= z= 35 | local KV_MAJOR=${x%%.*} 36 | y=${x#*.} 37 | [ "$x" = "$y" ] && y=0.0 38 | local KV_MINOR=${y%%.*} 39 | z=${y#*.} 40 | [ "$y" = "$z" ] && z=0 41 | local KV_MICRO=${z%%.*} 42 | local KV_int=$((${KV_MAJOR} * 65536 + ${KV_MINOR} * 256 + ${KV_MICRO} )) 43 | 44 | # We make version 2.2.0 the minimum version we will handle as 45 | # a sanity check ... if its less, we fail ... 46 | [ "${KV_int}" -lt 131584 ] && return 1 47 | 48 | echo "${KV_int}" 49 | } 50 | 51 | _RC_GET_KV_CACHE="" 52 | get_KV() 53 | { 54 | if [ -z "${_RC_GET_KV_CACHE}" ] ; then 55 | _RC_GET_KV_CACHE="$(uname -r)" 56 | fi 57 | echo "$(KV_to_int "${_RC_GET_KV_CACHE}")" 58 | return $? 59 | } 60 | 61 | # FIXME 62 | # Instead of this script testing kernel version, udev itself should 63 | # Maybe something like udevd --test || exit $? 64 | check_kernel() 65 | { 66 | if [ $(get_KV) -lt $(KV_to_int ${kv_min}) ]; then 67 | eerror "Your kernel is too old to work with this version of udev." 68 | eerror "Current udev only supports Linux kernel ${kv_min} and newer." 69 | return 1 70 | fi 71 | return 0 72 | } 73 | 74 | start_pre() 75 | { 76 | check_kernel || return 1 77 | if [ -e /proc/sys/kernel/hotplug ]; then 78 | echo "" >/proc/sys/kernel/hotplug 79 | fi 80 | 81 | # load unix domain sockets if built as module, Bug #221253 82 | # and not yet loaded, Bug #363549 83 | if [ ! -e /proc/net/unix ]; then 84 | if ! modprobe unix; then 85 | eerror "Cannot load the unix domain socket module" 86 | fi 87 | fi 88 | 89 | if yesno "${udev_debug}"; then 90 | command_args="${command_args} --debug 2> /run/udevdebug.log" 91 | fi 92 | } 93 | 94 | is_service_enabled() 95 | { 96 | local svc="$1" 97 | 98 | [ ! -e "/etc/init.d/${svc}" ] && return 1 99 | 100 | [ -e "/etc/runlevels/${RC_BOOTLEVEL}/${svc}" ] && return 0 101 | [ -e "/etc/runlevels/${RC_DEFAULTLEVEL}/${svc}" ] && return 0 102 | return 1 103 | } 104 | 105 | disable_oldnet_hotplug() 106 | { 107 | if is_service_enabled network; then 108 | # disable network hotplugging 109 | local f="/run/udev/rules.d/90-network.rules" 110 | echo "# This file disables network hotplug events calling" >> "${f}" 111 | echo "# old-style openrc net scripts" >> "${f}" 112 | echo "# as we use /etc/init.d/network to set up our network" >> "${f}" 113 | fi 114 | } 115 | 116 | start_udevmonitor() 117 | { 118 | yesno "${udev_monitor}" || return 0 119 | 120 | udevmonitor_log=/run/udevmonitor.log 121 | udevmonitor_pid=/run/udevmonitor.pid 122 | 123 | einfo "udev: Running udevadm monitor ${udev_monitor_opts} to log all events" 124 | start-stop-daemon --start --stdout "${udevmonitor_log}" \ 125 | --make-pidfile --pidfile "${udevmonitor_pid}" \ 126 | --background --exec /sbin/udevadm -- monitor ${udev_monitor_opts} 127 | } 128 | 129 | populate_dev() 130 | { 131 | if get_bootparam "nocoldplug" ; then 132 | rc_coldplug="NO" 133 | ewarn "Skipping udev coldplug as requested in kernel cmdline" 134 | fi 135 | 136 | ebegin "Populating /dev with existing devices through uevents" 137 | if ! yesno "${rc_coldplug}"; then 138 | # Do not run any init-scripts, Bug #206518 139 | udevadm control --property=do_not_run_plug_service=1 140 | fi 141 | udevadm trigger --type=subsystems --action=add 142 | udevadm trigger --type=devices --action=add 143 | eend $? 144 | ebegin "Waiting for uevents to be processed" 145 | udevadm settle --timeout=${udev_settle_timeout} 146 | eend $? 147 | udevadm control --property=do_not_run_plug_service= 148 | return 0 149 | } 150 | 151 | stop_udevmonitor() 152 | { 153 | yesno "${udev_monitor}" || return 0 154 | 155 | if yesno "${udev_monitor_keep_running}"; then 156 | ewarn "udev: udevmonitor is still running and writing into ${udevmonitor_log}" 157 | else 158 | einfo "udev: Stopping udevmonitor: Log is in ${udevmonitor_log}" 159 | start-stop-daemon --stop --pidfile "${udevmonitor_pid}" --exec /sbin/udevadm 160 | fi 161 | } 162 | 163 | display_hotplugged_services() 164 | { 165 | local svcfile= svc= services= 166 | for svcfile in "${RC_SVCDIR}"/hotplugged/*; do 167 | svc="${svcfile##*/}" 168 | [ -x "${svcfile}" ] || continue 169 | 170 | services="${services} ${svc}" 171 | done 172 | [ -n "${services}" ] && einfo "Device initiated services:${HILITE}${services}${NORMAL}" 173 | } 174 | 175 | start_post() 176 | { 177 | disable_oldnet_hotplug 178 | start_udevmonitor 179 | populate_dev 180 | stop_udevmonitor 181 | display_hotplugged_services 182 | return 0 183 | } 184 | 185 | reload() 186 | { 187 | ebegin "reloading udev rules and databases" 188 | udevadm control --reload 189 | eend $? 190 | } 191 | -------------------------------------------------------------------------------- /COPYING-GPLv2: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | --------------------------------------------------------------------------------