├── .gitignore ├── COPYRIGHT ├── PKGBUILD ├── README.md ├── etc └── sv │ ├── README │ ├── agetty-generic │ ├── finish │ ├── mksv │ ├── run │ └── supervise │ ├── agetty-tty1 │ ├── finish │ ├── run │ └── supervise │ ├── agetty-tty2 │ ├── finish │ ├── run │ └── supervise │ ├── agetty-tty3 │ ├── finish │ ├── run │ └── supervise │ ├── agetty-tty4 │ ├── finish │ ├── run │ └── supervise │ ├── agetty-tty5 │ ├── finish │ ├── run │ └── supervise │ ├── agetty-tty6 │ ├── finish │ ├── run │ └── supervise │ ├── apache2 │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── avahi │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── bumblebeed │ ├── log │ │ ├── rsvlog │ │ └── supervise │ ├── run │ └── supervise │ ├── couchdb │ ├── log │ │ ├── conf │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── cron │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── cups │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── dbus │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── fgetty-generic │ ├── README │ ├── finish │ ├── mksv │ ├── run │ └── supervise │ ├── fgetty-tty2 │ ├── finish │ ├── run │ └── supervise │ ├── fgetty-tty3 │ ├── finish │ ├── run │ └── supervise │ ├── freeswitch │ ├── log │ │ ├── conf │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── gdm │ ├── run │ └── supervise │ ├── gssd │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── idmapd │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── kdm │ ├── run │ └── supervise │ ├── lighttpd │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── lighttpd2 │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── memcached │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── mongodb │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── mysql │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── nfs-server │ ├── finish │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── ngetty │ ├── env │ │ └── TERM │ ├── run │ └── supervise │ ├── nginx │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── ntpd │ ├── log │ │ ├── conf │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── openntpd │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── openvpn │ ├── log │ │ └── run │ └── run │ ├── postfix │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── postgresql │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── redis │ ├── finish │ ├── log │ │ └── run │ ├── run │ └── supervise │ ├── rpcbind │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── sshd │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ ├── statd │ ├── log │ │ ├── run │ │ └── supervise │ ├── run │ └── supervise │ └── syslog-ng │ ├── finish │ ├── log │ ├── run │ └── supervise │ ├── run │ └── supervise ├── make-release.sh ├── rsvlog └── update_backups.rb /.gitignore: -------------------------------------------------------------------------------- 1 | pkg/ 2 | src/ 3 | *.xz 4 | *.gz 5 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2011, The Rubyists, LLC 2 | Our license for this work is same as the previous license in which we 3 | originally obtained this work. 4 | 5 | This work is based upon previous work by Andrej Gelenberg, his copyright is 6 | reproduced below: 7 | 8 | Copyright (c) 2010, Andrej Gelenberg 9 | 10 | This work is based upon previous work by Gerrit Pape, his copyright is 11 | reproduced below: 12 | 13 | Copyright (c) 2001-2008, Gerrit Pape 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | 19 | 1. Redistributions of source code must retain the above copyright notice, 20 | this list of conditions and the following disclaimer. 21 | 2. Redistributions in binary form must reproduce the above copyright 22 | notice, this list of conditions and the following disclaimer in the 23 | documentation and/or other materials provided with the distribution. 24 | 3. The name of the author may not be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 28 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 29 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 30 | EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 32 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 33 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 34 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 35 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 36 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | -------------------------------------------------------------------------------- /PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: TJ Vanderpoel 2 | # Maintainer: Kevin Berry 3 | pkgname='runit-services-git' 4 | pkgver=20110919 5 | pkgrel=5 6 | arch=('x86_64' 'i686') 7 | pkgdesc="A collection of commonly used service directories" 8 | url="http://github.com/rubyists/runit-services" 9 | license=('custom') 10 | provides=('runit-services') 11 | depends=('runit') 12 | makedepends=('git') 13 | backup=('etc/sv/agetty-generic/finish' 'etc/sv/agetty-generic/run' 'etc/sv/agetty-tty1/finish' 'etc/sv/agetty-tty1/run' 'etc/sv/agetty-tty2/finish' 'etc/sv/agetty-tty2/run' 'etc/sv/agetty-tty3/finish' 'etc/sv/agetty-tty3/run' 'etc/sv/agetty-tty4/finish' 'etc/sv/agetty-tty4/run' 'etc/sv/agetty-tty5/finish' 'etc/sv/agetty-tty5/run' 'etc/sv/agetty-tty6/finish' 'etc/sv/agetty-tty6/run' 'etc/sv/apache2/log/run' 'etc/sv/apache2/run' 'etc/sv/avahi/log/run' 'etc/sv/avahi/run' 'etc/sv/bumblebeed/run' 'etc/sv/couchdb/log/run' 'etc/sv/couchdb/run' 'etc/sv/cron/log/run' 'etc/sv/cron/run' 'etc/sv/cups/log/run' 'etc/sv/cups/run' 'etc/sv/dbus/log/run' 'etc/sv/dbus/run' 'etc/sv/fgetty-generic/finish' 'etc/sv/fgetty-generic/run' 'etc/sv/fgetty-tty2/finish' 'etc/sv/fgetty-tty2/run' 'etc/sv/fgetty-tty3/finish' 'etc/sv/fgetty-tty3/run' 'etc/sv/freeswitch/log/run' 'etc/sv/freeswitch/run' 'etc/sv/gdm/run' 'etc/sv/gssd/log/run' 'etc/sv/gssd/run' 'etc/sv/idmapd/log/run' 'etc/sv/idmapd/run' 'etc/sv/kdm/run' 'etc/sv/lighttpd/log/run' 'etc/sv/lighttpd/run' 'etc/sv/lighttpd2/log/run' 'etc/sv/lighttpd2/run' 'etc/sv/memcached/log/run' 'etc/sv/memcached/run' 'etc/sv/mongodb/log/run' 'etc/sv/mongodb/run' 'etc/sv/mysql/log/run' 'etc/sv/mysql/run' 'etc/sv/nfs-server/finish' 'etc/sv/nfs-server/log/run' 'etc/sv/nfs-server/run' 'etc/sv/ngetty/run' 'etc/sv/ntpd/log/run' 'etc/sv/ntpd/run' 'etc/sv/openntpd/log/run' 'etc/sv/openntpd/run' 'etc/sv/openvpn/log/run' 'etc/sv/openvpn/run' 'etc/sv/postfix/log/run' 'etc/sv/postfix/run' 'etc/sv/postgresql/log/run' 'etc/sv/postgresql/run' 'etc/sv/redis/finish' 'etc/sv/redis/log/run' 'etc/sv/redis/run' 'etc/sv/rpcbind/log/run' 'etc/sv/rpcbind/run' 'etc/sv/sshd/log/run' 'etc/sv/sshd/run' 'etc/sv/statd/log/run' 'etc/sv/statd/run' 'etc/sv/syslog-ng/finish' 'etc/sv/syslog-ng/log/run' 'etc/sv/syslog-ng/run') 14 | 15 | source=('rsvlog' 'COPYRIGHT' "README.md") 16 | md5sums=('1d70b6229d809076174d786926a9e356' 17 | '69ec4109404fce21737ac93f9d844d49' 18 | '48e57754259ba7b646ff30868b418fef') 19 | 20 | _gitroot="git://github.com/rubyists/runit-services.git" 21 | _gitname="runit-services" 22 | 23 | build() { 24 | cd "$srcdir" 25 | msg "Connecting to GIT server...." 26 | 27 | if [ -d $_gitname ] ; then 28 | cd $_gitname && git pull origin 29 | msg "The local files are updated." 30 | else 31 | git clone --depth=1 $_gitroot $_gitname 32 | fi 33 | 34 | msg "GIT checkout done or server timeout" 35 | msg "Starting make..." 36 | } 37 | 38 | package() { 39 | cd "$srcdir/$_gitname/" 40 | 41 | install -D -m 0755 rsvlog "$pkgdir/usr/bin/rsvlog" 42 | install -D -m 0644 COPYRIGHT "$pkgdir/usr/share/doc/runit-services/COPYRIGHT" 43 | install -D -m 0644 README.md "$pkgdir/usr/share/doc/runit-services/README.md" 44 | install -D -d "$pkgdir/etc/sv" 45 | 46 | for service in etc/sv/*;do 47 | cp -a $service "$pkgdir/etc/sv/" 48 | done 49 | } 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Description: 2 | 3 | * runit-services is a package which provides services for common daemons for use with runit. (http://smarden.org/runit) 4 | 5 | Usage: 6 | 7 | * This package places all the services in /etc/sv. You can enable each service by doing the folowing: 8 | ln -s /etc/sv/ /service 9 | * An example for sshd: 10 | ln -s /etc/sv/sshd /service 11 | * We'll try to maintain name compatibility with the services provided by the existing BSD-style init scripts in 12 | Archlinux. 13 | 14 | Support: 15 | 16 | * You can find Death_Syn or bougyman in #archlinux on freenode. 17 | 18 | 19 | -------------------------------------------------------------------------------- /etc/sv/README: -------------------------------------------------------------------------------- 1 | This directory contains service directories. A service directory has, 2 | at minimum, and executable file named 'run', which will setup and start 3 | the service in the foreground. If logging is sent to standard out, 4 | you may include a log/ directory in your service, which is essence 5 | just a standard service, needing only and executable 'run' file, that 6 | process is expected to accept stdin, which will be directed to it from 7 | the service process it is a child of. 8 | 9 | So: 10 | 11 | /etc/sv - contains services 12 | /etc/sv/sshd - A service directory 13 | /etc/sv/sshd/run - Starts sshd in the foreground, with logging to stdout 14 | /etc/sv/sshd/log/run - Starts the logging service for sshd, which accepts that stdout 15 | In this case, we use a symlink to /usr/bin/rsvlog, which is a 16 | generic wrapper for the runit 'svlogd' logger. See "man svlogd" 17 | for more information on svlogd, and check out the /usr/bin/rsvlog 18 | shell script for how to write your own. 19 | 20 | /service - The supervision directory, this can vary by supervisor, but this is the canonical 21 | location, and a symlink to your actual service directory (be it /var/service, /etc/service, 22 | whatever) should be made in order to guarantee compatibility with the widest 23 | variety of tools and utilities. 24 | 25 | The sv-helper package can be installed from the AUR which adds some simple wrappers for management 26 | of the symlinks in /service as well as status on services and bringing them up and down. 27 | -------------------------------------------------------------------------------- /etc/sv/agetty-generic/finish: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | service=$(basename $(pwd)) 3 | tty=${service/*-} 4 | exec utmpset -w $tty 5 | -------------------------------------------------------------------------------- /etc/sv/agetty-generic/mksv: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | tty=tty${1} 3 | if [ -d agetty-${tty} ];then 4 | echo "This tty already exists" 5 | exit 1 6 | fi 7 | mkdir agetty-${tty} 8 | ln -s /etc/sv/agetty-generic/run agetty-${tty}/ 9 | ln -s /etc/sv/agetty-generic/finish agetty-${tty}/ 10 | -------------------------------------------------------------------------------- /etc/sv/agetty-generic/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | service=$(basename $(pwd)) 3 | tty=${service/*-} 4 | 5 | exec /sbin/agetty -8 38400 $tty linux 6 | -------------------------------------------------------------------------------- /etc/sv/agetty-generic/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/agetty-generic -------------------------------------------------------------------------------- /etc/sv/agetty-tty1/finish: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/finish -------------------------------------------------------------------------------- /etc/sv/agetty-tty1/run: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/run -------------------------------------------------------------------------------- /etc/sv/agetty-tty1/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/agetty-tty1 -------------------------------------------------------------------------------- /etc/sv/agetty-tty2/finish: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/finish -------------------------------------------------------------------------------- /etc/sv/agetty-tty2/run: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/run -------------------------------------------------------------------------------- /etc/sv/agetty-tty2/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/agetty-tty2 -------------------------------------------------------------------------------- /etc/sv/agetty-tty3/finish: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/finish -------------------------------------------------------------------------------- /etc/sv/agetty-tty3/run: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/run -------------------------------------------------------------------------------- /etc/sv/agetty-tty3/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/agetty-tty3 -------------------------------------------------------------------------------- /etc/sv/agetty-tty4/finish: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/finish -------------------------------------------------------------------------------- /etc/sv/agetty-tty4/run: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/run -------------------------------------------------------------------------------- /etc/sv/agetty-tty4/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/agetty-tty4 -------------------------------------------------------------------------------- /etc/sv/agetty-tty5/finish: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/finish -------------------------------------------------------------------------------- /etc/sv/agetty-tty5/run: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/run -------------------------------------------------------------------------------- /etc/sv/agetty-tty5/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/agetty-tty5 -------------------------------------------------------------------------------- /etc/sv/agetty-tty6/finish: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/finish -------------------------------------------------------------------------------- /etc/sv/agetty-tty6/run: -------------------------------------------------------------------------------- 1 | /etc/sv/agetty-generic/run -------------------------------------------------------------------------------- /etc/sv/agetty-tty6/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/agetty-tty6 -------------------------------------------------------------------------------- /etc/sv/apache2/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/apache2/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/apache2.log -------------------------------------------------------------------------------- /etc/sv/apache2/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec 2>&1 3 | exec httpd -eDEBUG -DNO_DETACH -DFOREGROUND 4 | -------------------------------------------------------------------------------- /etc/sv/apache2/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/apache2 -------------------------------------------------------------------------------- /etc/sv/avahi/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/avahi/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/avahi.log -------------------------------------------------------------------------------- /etc/sv/avahi/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sv start dbus || exit 1 3 | exec avahi-daemon 4 | -------------------------------------------------------------------------------- /etc/sv/avahi/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/avahi -------------------------------------------------------------------------------- /etc/sv/bumblebeed/log/rsvlog: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/bumblebeed/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/bumblebeed.log -------------------------------------------------------------------------------- /etc/sv/bumblebeed/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec /usr/sbin/bumblebeed 2>&1 4 | -------------------------------------------------------------------------------- /etc/sv/bumblebeed/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/bumblebeed -------------------------------------------------------------------------------- /etc/sv/couchdb/log/conf: -------------------------------------------------------------------------------- 1 | USERGROUP=couchdb:daemon 2 | -------------------------------------------------------------------------------- /etc/sv/couchdb/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/couchdb/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/couchdb.log -------------------------------------------------------------------------------- /etc/sv/couchdb/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export HOME=/var/lib/couchdb 4 | 5 | exec chpst -u couchdb:daemon /usr/bin/couchdb 2>&1 6 | -------------------------------------------------------------------------------- /etc/sv/couchdb/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/couchdb -------------------------------------------------------------------------------- /etc/sv/cron/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/cron/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/cron.log -------------------------------------------------------------------------------- /etc/sv/cron/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | pacman -Qq dcron 2>&1 >/dev/null 3 | if [ $? -eq 0 ];then 4 | exec crond -f 2>&1 5 | fi 6 | exec crond -n 2>&1 7 | -------------------------------------------------------------------------------- /etc/sv/cron/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/cron -------------------------------------------------------------------------------- /etc/sv/cups/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/cups/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/cups.log -------------------------------------------------------------------------------- /etc/sv/cups/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec cupsd -f 3 | -------------------------------------------------------------------------------- /etc/sv/cups/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/cups -------------------------------------------------------------------------------- /etc/sv/dbus/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/dbus/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/dbus.log -------------------------------------------------------------------------------- /etc/sv/dbus/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -e /var/run/dbus.pid ] ; then 3 | rm /var/run/dbus.pid 4 | fi 5 | if [ ! -x /var/run/dbus ] ; then 6 | install -m755 -g 81 -o 81 -d /var/run/dbus 7 | fi 8 | if [ -x /usr/bin/dbus-uuidgen ] ; then 9 | dbus-uuidgen --ensure 10 | fi 11 | sed -i 's/^[[:space:]]*//;s/^[[:space:]]*\(.*<\/pidfile>\)//' /etc/dbus-1/system.conf 12 | exec dbus-daemon --system 13 | -------------------------------------------------------------------------------- /etc/sv/dbus/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/dbus -------------------------------------------------------------------------------- /etc/sv/fgetty-generic/README: -------------------------------------------------------------------------------- 1 | This directory is a generic run script for fgetty. 2 | 3 | To create a service (assuming we are in /etc/sv/fgetty-generic): 4 | 5 | # For tty1 6 | cd /etc/sv 7 | ./fgetty-generic/mksv 1 8 | 9 | You will now have /etc/sv/fgetty-tty1 which you can symlink to 10 | your supervision directory. 11 | -------------------------------------------------------------------------------- /etc/sv/fgetty-generic/finish: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | service=$(basename $(pwd)) 3 | tty=${service/*-} 4 | exec utmpset -w $tty 5 | -------------------------------------------------------------------------------- /etc/sv/fgetty-generic/mksv: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | tty=tty${1} 3 | if [ -d fgetty-${tty} ];then 4 | echo "This tty already exists" 5 | exit 1 6 | fi 7 | mkdir fgetty-${tty} 8 | ln -s /etc/sv/fgetty-generic/run fgetty-${tty}/ 9 | ln -s /etc/sv/fgetty-generic/finish fgetty-${tty}/ 10 | -------------------------------------------------------------------------------- /etc/sv/fgetty-generic/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | service=$(basename $(pwd)) 3 | tty=${service/*-} 4 | 5 | exec /sbin/fgetty $tty 6 | -------------------------------------------------------------------------------- /etc/sv/fgetty-generic/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/fgetty-generic -------------------------------------------------------------------------------- /etc/sv/fgetty-tty2/finish: -------------------------------------------------------------------------------- 1 | /etc/sv/fgetty-generic/finish -------------------------------------------------------------------------------- /etc/sv/fgetty-tty2/run: -------------------------------------------------------------------------------- 1 | /etc/sv/fgetty-generic/run -------------------------------------------------------------------------------- /etc/sv/fgetty-tty2/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/fgetty-tty2 -------------------------------------------------------------------------------- /etc/sv/fgetty-tty3/finish: -------------------------------------------------------------------------------- 1 | /etc/sv/fgetty-generic/finish -------------------------------------------------------------------------------- /etc/sv/fgetty-tty3/run: -------------------------------------------------------------------------------- 1 | /etc/sv/fgetty-generic/run -------------------------------------------------------------------------------- /etc/sv/fgetty-tty3/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/fgetty-tty3 -------------------------------------------------------------------------------- /etc/sv/freeswitch/log/conf: -------------------------------------------------------------------------------- 1 | USERGROUP=freeswitch:daemon 2 | -------------------------------------------------------------------------------- /etc/sv/freeswitch/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/freeswitch/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/freeswitch.log -------------------------------------------------------------------------------- /etc/sv/freeswitch/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | ulimit -c unlimited # The maximum size of core files created. 4 | ulimit -d unlimited # The maximum size of a process's data segment. 5 | ulimit -f unlimited # The maximum size of files created by the shell (default option) 6 | ulimit -i unlimited # The maximum number of pending signals 7 | ulimit -n 999999 # The maximum number of open file descriptors. 8 | ulimit -q unlimited # The maximum POSIX message queue size 9 | ulimit -u unlimited # The maximum number of processes available to a single user. 10 | ulimit -v unlimited # The maximum amount of virtual memory available to the process. 11 | ulimit -x unlimited # ??? 12 | ulimit -s 8192 # The maximum stack size 13 | ulimit -l unlimited # The maximum size that may be locked into memory. 14 | ulimit -a # All current limits are reported. 15 | echo "Starting Freeswitch" 16 | exec chpst -u freeswitch:daemon /usr/bin/freeswitch -u freeswitch -g daemon -nf -nc -nonat 2>&1 17 | 18 | -------------------------------------------------------------------------------- /etc/sv/freeswitch/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/freeswitch -------------------------------------------------------------------------------- /etc/sv/gdm/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec /usr/bin/gdm -nodaemon 1>&2 4 | -------------------------------------------------------------------------------- /etc/sv/gdm/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/gdm -------------------------------------------------------------------------------- /etc/sv/gssd/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/gssd/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/gssd.log -------------------------------------------------------------------------------- /etc/sv/gssd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | exec 2>&1 4 | exec /usr/sbin/rpc.gssd -f 5 | -------------------------------------------------------------------------------- /etc/sv/gssd/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/gssd -------------------------------------------------------------------------------- /etc/sv/idmapd/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/idmapd/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/idmapd.log -------------------------------------------------------------------------------- /etc/sv/idmapd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | exec 2>&1 4 | exec /usr/sbin/rpc.idmapd -v -f 5 | -------------------------------------------------------------------------------- /etc/sv/idmapd/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/idmapd -------------------------------------------------------------------------------- /etc/sv/kdm/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec /usr/bin/kdm -nodaemon 1>&2 4 | -------------------------------------------------------------------------------- /etc/sv/kdm/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/kdm -------------------------------------------------------------------------------- /etc/sv/lighttpd/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/lighttpd/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/lighttpd.log -------------------------------------------------------------------------------- /etc/sv/lighttpd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec 2>&1 3 | echo 'lighttpd starting.' 4 | 5 | LANG=C LC_ALL=C \ 6 | exec /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -D 7 | -------------------------------------------------------------------------------- /etc/sv/lighttpd/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/lighttpd -------------------------------------------------------------------------------- /etc/sv/lighttpd2/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/lighttpd2/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/lighttpd2.log -------------------------------------------------------------------------------- /etc/sv/lighttpd2/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec 2>&1 3 | echo 'lighttpd2 starting.' 4 | 5 | LANG=C LC_ALL=C \ 6 | exec /usr/sbin/lighttpd2 -c /etc/lighttpd2/angel.conf 7 | -------------------------------------------------------------------------------- /etc/sv/lighttpd2/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/lighttpd2 -------------------------------------------------------------------------------- /etc/sv/memcached/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/memcached/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/memcached.log -------------------------------------------------------------------------------- /etc/sv/memcached/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec /usr/bin/memcached -u nobody -l 127.0.0.1 2>&1 4 | -------------------------------------------------------------------------------- /etc/sv/memcached/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/memcached -------------------------------------------------------------------------------- /etc/sv/mongodb/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/mongodb/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/mongodb.log -------------------------------------------------------------------------------- /etc/sv/mongodb/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec chpst -u mongodb:daemon /usr/bin/mongod -f /etc/mongodb.conf 2>&1 4 | -------------------------------------------------------------------------------- /etc/sv/mongodb/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/mongodb -------------------------------------------------------------------------------- /etc/sv/mysql/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/mysql/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/mysql.log -------------------------------------------------------------------------------- /etc/sv/mysql/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | exec 2>&1 3 | exec mysqld_safe --console --user=mysql 4 | -------------------------------------------------------------------------------- /etc/sv/mysql/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/mysql -------------------------------------------------------------------------------- /etc/sv/nfs-server/finish: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec 2>&1 3 | # shut down the nfsd threads. 4 | /usr/sbin/rpc.nfsd -- 0 5 | /usr/sbin/exportfs -a -u 6 | -------------------------------------------------------------------------------- /etc/sv/nfs-server/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/nfs-server/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/nfs-server.log -------------------------------------------------------------------------------- /etc/sv/nfs-server/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #!/bin/bash 4 | exec 2>&1 5 | 6 | # Make sure the statd service is running. 7 | sv check statd 8 | 9 | # Get the nfs service parameters from the LFS standard file 10 | # this sets some envars. 11 | source /etc/conf.d/nfs-server.conf 12 | 13 | echo "Loading kernel modules" 14 | modprobe sunrpc 15 | modprobe nfs 16 | modprobe nfsd 17 | 18 | echo "Mounting pipefs filesystem" 19 | mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs defaults 20 | 21 | # Uncomment this and add the two daemons if you need kerberos support. 22 | # sv check idmapd gssd 23 | 24 | echo "Mounting NFS filesystem" 25 | mount -t nfsd nfsd /proc/fs/nfsd 26 | 27 | echo "Re-export all directories in /etc/exports" 28 | /usr/sbin/exportfs -ra > /dev/null 29 | 30 | echo "start some nfsd threads" 31 | /usr/sbin/rpc.nfsd -- ${NFSD_COUNT:-8} 32 | 33 | echo "Start the rpc.mountd daemon" 34 | exec /usr/sbin/rpc.mountd --foreground 35 | -------------------------------------------------------------------------------- /etc/sv/nfs-server/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/nfs-server -------------------------------------------------------------------------------- /etc/sv/ngetty/env/TERM: -------------------------------------------------------------------------------- 1 | linux -------------------------------------------------------------------------------- /etc/sv/ngetty/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec chpst -e ./env /sbin/ngetty tty2 tty3 tty4 4 | -------------------------------------------------------------------------------- /etc/sv/ngetty/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/ngetty -------------------------------------------------------------------------------- /etc/sv/nginx/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/nginx/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/nginx.log -------------------------------------------------------------------------------- /etc/sv/nginx/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec 2>&1 3 | 4 | exec /usr/bin/nginx -g "daemon off;" 5 | -------------------------------------------------------------------------------- /etc/sv/nginx/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/nginx -------------------------------------------------------------------------------- /etc/sv/ntpd/log/conf: -------------------------------------------------------------------------------- 1 | USERGROUP=ntp:daemon 2 | -------------------------------------------------------------------------------- /etc/sv/ntpd/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/ntpd/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/ntpd.log -------------------------------------------------------------------------------- /etc/sv/ntpd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | if [ -f /etc/conf.d/ntp-client.conf ];then 3 | . /etc/conf.d/ntp-client.conf 4 | fi 5 | /usr/bin/ntpd -n -q $NTP_CLIENT_OPTION 6 | exec /usr/bin/ntpd $NTPD_ARGS -u ntp -n 2>&1 7 | -------------------------------------------------------------------------------- /etc/sv/ntpd/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/ntpd -------------------------------------------------------------------------------- /etc/sv/openntpd/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/openntpd/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/openntpd.log -------------------------------------------------------------------------------- /etc/sv/openntpd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec /usr/sbin/ntpd -s -d 2>&1 4 | -------------------------------------------------------------------------------- /etc/sv/openntpd/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/openntpd -------------------------------------------------------------------------------- /etc/sv/openvpn/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/openvpn/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec /usr/sbin/openvpn 2>&1 4 | -------------------------------------------------------------------------------- /etc/sv/postfix/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/postfix/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/postfix.log -------------------------------------------------------------------------------- /etc/sv/postfix/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | command_directory=`postconf -h command_directory` 4 | daemon_directory=`$command_directory/postconf -h daemon_directory` 5 | 6 | # make consistency check 7 | $command_directory/postfix check 2>&1 8 | 9 | # run Postfix 10 | exec $daemon_directory/master 2>&1 11 | -------------------------------------------------------------------------------- /etc/sv/postfix/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/postfix -------------------------------------------------------------------------------- /etc/sv/postgresql/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/postgresql/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/postgresql.log -------------------------------------------------------------------------------- /etc/sv/postgresql/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /etc/conf.d/postgresql 4 | 5 | exec chpst -u postgres /usr/bin/postgres -D $PGROOT/data -c config_file=$PGROOT/data/postgresql.conf 6 | -------------------------------------------------------------------------------- /etc/sv/postgresql/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/postgresql -------------------------------------------------------------------------------- /etc/sv/redis/finish: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | EXEC=/usr/bin/redis-server 4 | WORKDIR=/var/lib/redis 5 | CONF="/etc/redis.conf" 6 | 7 | sed -ie 's/^daemonize no/daemonize yes/' $CONF 8 | exit 0 9 | -------------------------------------------------------------------------------- /etc/sv/redis/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/redis/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | EXEC=/usr/bin/redis-server 3 | WORKDIR=/var/lib/redis 4 | CONF="/etc/redis.conf" 5 | [ -d $WORKDIR ] || mkdir $WORKDIR 6 | sed -ie 's/^daemonize yes/daemonize no/' $CONF 7 | exec $EXEC 2>&1 8 | -------------------------------------------------------------------------------- /etc/sv/redis/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/redis -------------------------------------------------------------------------------- /etc/sv/rpcbind/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/rpcbind/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/rpcbind.log -------------------------------------------------------------------------------- /etc/sv/rpcbind/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | exec 2>&1 4 | # run in debug mode to prevent forking 5 | exec rpcbind -d 6 | -------------------------------------------------------------------------------- /etc/sv/rpcbind/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/rpcbind -------------------------------------------------------------------------------- /etc/sv/sshd/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/sshd/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/sshd.log -------------------------------------------------------------------------------- /etc/sv/sshd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /usr/bin/ssh-keygen -A # Will generate host keys if they don't already exist 4 | exec /usr/sbin/sshd -De 2>&1 5 | -------------------------------------------------------------------------------- /etc/sv/sshd/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/sshd -------------------------------------------------------------------------------- /etc/sv/statd/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/statd/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/statd.log -------------------------------------------------------------------------------- /etc/sv/statd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec 2>&1 4 | 5 | # Make sure the portmap service is running. 6 | sv check rpcbind 7 | 8 | exec rpc.statd -F -d 9 | -------------------------------------------------------------------------------- /etc/sv/statd/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/statd -------------------------------------------------------------------------------- /etc/sv/syslog-ng/finish: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec 2>&1 3 | sed -i -e 's|unix-dgram("/dev/log");|unix-dgram("/run/systemd/journal/syslog");|' /etc/syslog-ng/syslog-ng.conf 4 | -------------------------------------------------------------------------------- /etc/sv/syslog-ng/log/run: -------------------------------------------------------------------------------- 1 | /usr/bin/rsvlog -------------------------------------------------------------------------------- /etc/sv/syslog-ng/log/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/syslog-ng.log -------------------------------------------------------------------------------- /etc/sv/syslog-ng/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec 2>&1 3 | sed -i -e 's|unix-dgram("/run/systemd/journal/syslog");|unix-dgram("/dev/log");|' /etc/syslog-ng/syslog-ng.conf 4 | exec syslog-ng -F 5 | -------------------------------------------------------------------------------- /etc/sv/syslog-ng/supervise: -------------------------------------------------------------------------------- 1 | /run/runit/sv/syslog-ng -------------------------------------------------------------------------------- /make-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source PKGBUILD 3 | curdir=$PWD 4 | tmpdir=$(mktemp -d) 5 | cd $tmpdir 6 | git clone $curdir 7 | checkout=${curdir##*/} 8 | rm -rf $checkout/.git $checkout/make-release.sh $checkout/.gitignore $checkout/PKGBUILD 9 | tar czvf "${pkgname}-${pkgver}-${pkgrel}.tar.gz" $checkout 10 | cp "${pkgname}-${pkgver}-${pkgrel}.tar.gz" $curdir 11 | echo "Wrote ${pkgname}-${pkgver}-${pkgrel}.tar.gz" 12 | -------------------------------------------------------------------------------- /rsvlog: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | if [ $0 != "./run" ];then 4 | echo "This script meant to be linked as ./run in a service/log directory only!" 5 | exit 1 6 | fi 7 | curdir=$(basename $(pwd)) 8 | if [ "$curdir" != "log" ];then 9 | echo "This script meant to be run from a service/log directory only!" 10 | exit 1 11 | fi 12 | if [ -f ./conf ];then 13 | source ./conf 14 | fi 15 | if [ ! -v SV_TIMESTAMP ];then 16 | echo "Setting default timestamp" 17 | # Default to tai64 timestamps 18 | SV_TIMESTAMP="-t" 19 | fi 20 | if [ "x$SV_LOGDIR" != "x" ];then 21 | logdir=$SV_LOGDIR 22 | fi 23 | if [ -w /var/log ];then 24 | user_group=${USERGROUP:-daemon:adm} 25 | if [ "x$logdir" == "x" ];then 26 | logdir=$(basename $(dirname $(pwd))) 27 | fi 28 | [ -d "/var/log/$logdir" ] || mkdir -p "/var/log/$logdir" 29 | [ -L ./main ] || [ -d ./main ] || ln -s "/var/log/$logdir" ./main 30 | [ -L ./current ] || ln -s main/current 31 | if [ "x$CURRENT_LOG_FILE" != "x" ];then 32 | [ -L "/var/log/$logdir/$CURRENT_LOG_FILE" ] || ln -s current "/var/log/$logdir/$CURRENT_LOG_FILE" 33 | fi 34 | usergroup=$(stat -c "%U:%G" "/var/log/$logdir") 35 | if [ "$usergroup" != "$user_group" ];then 36 | chown -R $user_group "/var/log/$logdir" 37 | fi 38 | echo Logging as $user_group to /var/log/$logdir 39 | exec chpst -u $user_group svlogd ${SV_TIMESTAMP} ./main 40 | else 41 | echo Logging in $PWD 42 | if [ "x$CURRENT_LOG_FILE" != "x" ];then 43 | [ -L "$CURRENT_LOG_FILE" ] || ln -s current "$CURRENT_LOG_FILE" 44 | fi 45 | exec svlogd ${SV_TIMESTAMP} ./ 46 | fi 47 | -------------------------------------------------------------------------------- /update_backups.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require "find" 4 | 5 | configs = [] # Array to hold list of config files to save 6 | Find.find("etc") do |path| 7 | configs << path if File.basename(path) == 'run' 8 | configs << path if File.basename(path) == 'finish' 9 | configs << path if File.dirname(path).match(/\/env\//) 10 | configs << path if File.dirname(path).match(/\/control\//) 11 | end 12 | 13 | pkgbuild = File.readlines("PKGBUILD") 14 | 15 | File.open("PKGBUILD","w") do |f| 16 | pkgbuild.each do |l| 17 | if l[0,6] == "backup" 18 | l = "backup=(\'#{configs.join("\' \'")}\')" 19 | end 20 | f.puts l.chomp 21 | end 22 | end 23 | --------------------------------------------------------------------------------