Browse Source

Alejandro Mery <amery@geeks.cl>:

updates runit and make it able to really boot a ROCK.
 - system
 - ttys
 - cron
 - sysklogd


git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@1986 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
rocklinux
Alejandro Mery 21 years ago
parent
commit
a14c0c54ce
12 changed files with 194 additions and 55 deletions
  1. +1
    -0
      Documentation/Developers/CHANGELOG-RENE
  2. +20
    -14
      package/mnemoc/runit/djb-config
  3. +3
    -0
      package/mnemoc/runit/packages/cron-runit-cron_run.txt
  4. +5
    -0
      package/mnemoc/runit/packages/openssh-log_run.txt
  5. +4
    -0
      package/mnemoc/runit/packages/openssh-run.txt
  6. +3
    -0
      package/mnemoc/runit/packages/sysklogd-runit-klogd_run.txt
  7. +3
    -0
      package/mnemoc/runit/packages/sysklogd-runit-syslogd_run.txt
  8. +25
    -8
      package/mnemoc/runit/parse-config
  9. +63
    -0
      package/mnemoc/runit/rockify.patch
  10. +8
    -8
      package/mnemoc/runit/runit.cache
  11. +57
    -23
      package/mnemoc/runit/runit.conf
  12. +2
    -2
      package/mnemoc/runit/runit.desc

+ 1
- 0
Documentation/Developers/CHANGELOG-RENE

@ -3,6 +3,7 @@
- mine mangling
- Alejandro Mery: updated links, openldap, perl-libxml and mono-debugger
updated runit, and make it ROCK
*) 2003-12-13 (2.0.0-rc3 - 2.0.0-rc4)

+ 20
- 14
package/mnemoc/runit/djb-config

@ -21,22 +21,25 @@
# --- ROCK-COPYRIGHT-NOTE-END ---
# why to use this secure stuff?
# because we can be updating.
# because we can be updating... sure?
# to honor daemontools behavior :-)
#
pkg_djb_securecopy() {
echo "'$1/$3' -> '$2/$3'"
echo "'${1#root}/$3' -> '${2#root}/$3'"
rm -f $2/$3'{new}'
cp -p $1/$3 $2/$3'{new}'
mv -f $2/$3'{new}' $2/$3
}
pkg_djb_securelink() {
echo "create symbolic link '$1/$3' to '$2/$3'"
echo "create symbolic link '${1#root}/$3' to '${2#root}/$3'"
rm -f $2/$3'{new}'
ln -s $1/$3 $2/$3'{new}'
mv -f $2/$3'{new}' $2/$3
}
# installs the package in DJB way if requested
#
pkg_djb_installpackage() {
# requires ./package/commands
# and files in ./command
@ -63,14 +66,15 @@ pkg_djb_installpackage() {
$pkg_djb_commanddir $i
done
if [ $ROCKCFG_PKG_DJB_COMPAT -eq 1 ]; then
echo "Making compatibility links in $pkg_djb_compatdir..."
mkdir -p $pkg_djb_compatdir
for i in `cat package/commands`; do
pkg_djb_securelink $pkg_djb_packagedir/$package/$pkg-$ver/command \
$pkg_djb_compatdir $i
done
fi
# usr/local is evil :)
#if [ $ROCKCFG_PKG_DJB_COMPAT -eq 1 ]; then
# echo "Making compatibility links in $pkg_djb_compatdir..."
# mkdir -p $pkg_djb_compatdir
# for i in `cat package/commands`; do
# pkg_djb_securelink $pkg_djb_packagedir/$package/$pkg-$ver/command \
# $pkg_djb_compatdir $i
# done
#fi
else
echo 'Copying commands to package directory...'
pkg_djb_commanddir=$altdir
@ -81,6 +85,8 @@ pkg_djb_installpackage() {
fi
}
# installs package files into package directory or $docdir as requested
#
pkg_djb_installdoc() {
local package=$1
@ -110,10 +116,10 @@ pkg_djb_installdoc() {
pkg_djb_packagedir="$root/package"
pkg_djb_commanddir="$root/command"
pkg_djb_compatdir="$root/usr/local/bin"
#pkg_djb_compatdir="$root/usr/local/bin"
if [ "$ROCKCFG_PKG_DJB_LAYOUT" == "1" ]; then
pkg_djb_servicedir="$root/service"
else
pkg_djb_servicedir="$root/etc/service"
pkg_djb_servicedir="$root/var/service"
fi

+ 3
- 0
package/mnemoc/runit/packages/cron-runit-cron_run.txt

@ -0,0 +1,3 @@
#!/bin/sh
exec 2>&1
exec /usr/sbin/cron -f

+ 5
- 0
package/mnemoc/runit/packages/openssh-log_run.txt

@ -0,0 +1,5 @@
#!/bin/sh
exec 2>&1
mkdir -p main
exec svlogd -t main

+ 4
- 0
package/mnemoc/runit/packages/openssh-run.txt

@ -0,0 +1,4 @@
#!/bin/sh
exec 2>&1
exec /usr/sbin/sshd -De

+ 3
- 0
package/mnemoc/runit/packages/sysklogd-runit-klogd_run.txt

@ -0,0 +1,3 @@
#!/bin/sh
exec 2>&1
exec chpst -Unobody /usr/sbin/klogd -n

+ 3
- 0
package/mnemoc/runit/packages/sysklogd-runit-syslogd_run.txt

@ -0,0 +1,3 @@
#!/bin/sh
exec 2>&1
exec chpst -Unobody /usr/sbin/syslogd -n

+ 25
- 8
package/mnemoc/runit/parse-config

@ -30,18 +30,35 @@ if [ "$ROCKCFG_PKG_DJB_LAYOUT" == "1" ]; then
var_append flistroot ' ' $x
done
if [ "$pkg" == "runit" ]; then
for x in package service command; do
add_flist $xroot/$x/
done
chmod 1755 $xroot/package
hook_add premake 1 'for x in package service command; do \
add_flist $xroot/$x/; \
done ; \
chmod 1755 $xroot/package'
fi
elif [ "$ROCKCFG_PKG_DJB_LAYOUT" == "0" ]; then
mkdir -p $xroot/etc/service
if [ "$pkg" == "runit" ]; then
add_flist $xroot/etc/service
hook_add premake 1 'add_flist $xroot/etc/service'
fi
else
# nothing about DJB layout on config =(
true
fi
#
# add init scripts
#
if pkgcheck runit X; then
runitconfdir=$base/package/mnemoc/runit
for x in `ls $runitconfdir/packages/$pkg-*.txt 2> /dev/null`; do
y=${x##*/}; y=${y#$pkg-}; y=${y%.txt}; y=${y//_/\/}
echo_status "Seting to install ${x##*/}"
if [ "${y#runit-}" != "$y" ]; then
y=${y#runit-}
hook_add postmake 8 "mkdir -p $root/etc/runit/${y%/*}; \
cp -fv $x $root/etc/runit/$y; \
chmod 744 $root/etc/runit/$y;"
else
hook_add postmake 8 "mkdir -p $sysconfdir/${y%/*}; \
cp -fv $x $sysconfdir/$y; \
chmod 744 $sysconfdir/$y;"
fi
done
fi

+ 63
- 0
package/mnemoc/runit/rockify.patch

@ -0,0 +1,63 @@
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/package/mnemoc/runit/rockify.patch
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. A copy of the GNU General Public
# License can be found at Documentation/COPYING.
#
# Many people helped and are helping developing ROCK Linux. Please
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
# file for details.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
we need to export vars to be read inside init.d/system
currently we simulate sysv's stage 2
Alejandro
--- ./doc/debian/1.orig 2003-10-29 18:28:27.000000000 +0000
+++ ./doc/debian/1 2003-11-11 02:43:07.000000000 +0000
@@ -1,10 +1,9 @@
#!/bin/sh
# system one time tasks
-PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin
+export PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin
-/etc/init.d/rcS
-/etc/init.d/rmnologin
+/etc/rc.d/init.d/system start
touch /etc/runit/stopit
chmod 0 /etc/runit/stopit
--- ./etc/debian/3.orig 2003-11-18 12:47:03.000000000 -0300
+++ ./etc/debian/3 2003-12-07 10:28:44.000000000 -0300
@@ -1,10 +1,10 @@
#!/bin/sh
exec 2>&1
-PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin
+export PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin
-LAST=0
-test -x /etc/runit/reboot && LAST=6
+export RUNLEVEL=0
+test -x /etc/runit/reboot && export RUNLEVEL=6
echo 'Waiting for getties to stop...'
svwaitdown -xk -t14 /var/service/getty-*
@@ -13,4 +13,4 @@
svwaitdown -xk -t350 /var/service/*
echo 'Shutdown...'
-/etc/init.d/rc $LAST
+/etc/rc.d/init.d/system stop

+ 8
- 8
package/mnemoc/runit/runit.cache

@ -20,15 +20,15 @@
[COPY]
[COPY] --- ROCK-COPYRIGHT-NOTE-END ---
[TIMESTAMP] 1064105482 Sat Sep 20 20:51:22 2003
[CONFIG-ID] 2.0.0-rc2-x86-pentium2-32-mnemosyne-expert
[ROCKVER] 2.0.0-rc2
[TIMESTAMP] 1070888440 Mon Dec 8 10:00:40 2003
[CONFIG-ID] 2.0.0-rc4-x86-pentium2-32-mnemosyne-expert
[ROCKVER] 2.0.0-rc4
[LOGS] 1-runit.log 5-runit.log 9-runit.log
[LOGS] 1-runit.log 5-runit.log
[BUILDTIME] 5801 (9)
[SIZE] 1.84 MB, 86 files
[BUILDTIME] 7577 (5)
[SIZE] 1.87 MB, 105 files
[DEP] bash binutils bzip2 ccache coreutils findutils gawk gcc33 glibc23
[DEP] grep gzip linux24-header make runit sed sysfiles tar
[DEP] bash binutils bzip2 coreutils findutils gcc33 glibc23 grep gzip
[DEP] linux24-header make patch runit sed sysfiles tar

+ 57
- 23
package/mnemoc/runit/runit.conf

@ -19,52 +19,77 @@
# file for details.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
prefix=''
set_confopt
[ "$prefix" = usr ] && sbindir="$root/sbin"
. $base/package/mnemoc/runit/djb-config
pkg_runit_main() {
local agettyargs speed
hook_eval premake
./package/compile
hook_eval inmake
pkg_djb_installpackage admin $sbindir
hook_eval postmake
# main scripts and virtual consoles
if [ "`echo $sysconfdir/*`" == "$sysconfdir/*" ]; then
#if [ ! -f $sysconfdir/1 ]; then
echo "Creating main scripts and virtual consoles..."
mkdir -p $sysconfdir
cp -vp ./etc/debian/[123] $sysconfdir/
cp -vp ./etc/debian/ctrlaltdel $sysconfdir/
local agettyargs
for i in 1 2 3 4 5 6; do
echo "Creating getty tty$i..."
mkdir -p $sysconfdir/getty-$i
if [ $i -eq 1 ]; then
agettyargs='-i -I '"'"'\012\015\012Maintenance Console:\012'"'"
cp -vf ./doc/debian/[123] $sysconfdir/
cp -vf ./doc/debian/ctrlaltdel $sysconfdir/
chmod 744 $sysconfdir/[123]
chmod 744 $sysconfdir/ctrlaltdel
for i in console 1 2 3 4 5 6; do
if [ "$i" == "console" ]; then
echo "Creating getty $i..."
speed=9600
else
echo "Creating getty tty$i..."
i="vc/$i"
speed=38400
fi
mkdir -p $sysconfdir/getty-${i#vc/}
if [ "$i" == "console" -o "$i" == "vc/1" ]; then
agettyargs='-L -i -I '"'"'\012\015\012Maintenance Console:\012'"'"
else
agettyargs='-f /etc/issue.ansi'
fi
cat << EOT > $sysconfdir/getty-$i/run
cat << EOT > $sysconfdir/getty-${i#vc/}/run
#!/bin/sh
${pkg_djb_commanddir#$root}/utmpset -w vc/$i
exec /sbin/agetty $agettyargs 38400 vc/$i linux
${pkg_djb_commanddir#$root}/utmpset -w $i
exec /sbin/agetty $agettyargs $speed $i linux
EOT
chmod +x $sysconfdir/getty-$i/run
chmod 744 $sysconfdir/getty-${i#vc/}/run
done
fi
#fi
# getties to svscan
echo "Make getties available to svscan..."
for i in 1 2 3 4 5 6; do
ln -sfv ${sysconfdir%$root}/getty-$i $pkg_djb_servicedir/
ln -sfv ${sysconfdir#$root}/getty-$i $pkg_djb_servicedir/
done
# and minimal services
if pkgcheck sysklogd X; then
echo "Make sysklogd available to svscan..."
ln -sfv ${sysconfdir#$root}/syslogd $pkg_djb_servicedir/
ln -sfv ${sysconfdir#$root}/klogd $pkg_djb_servicedir/
fi
if pkgcheck cron X; then
echo "Make cron available to svscan..."
ln -sfv ${sysconfdir#$root}/cron $pkg_djb_servicedir/
fi
if [ ${pkg_djb_commanddir} != $sbindir ]; then
echo "Copying init files to /sbin..."
cp -vf ${pkg_djb_commanddir}/runit* $sbindir/
fi
}
pkg_runit_doc() {
@ -80,11 +105,20 @@ pkg_runit_doc() {
fi
}
if [ $ROCKCFG_PKG_DJB_LAYOUT -eq 0 ]; then
hook_add prepatch 5 "for x in ./etc/debian/*; do \
if [ -f $x ]; then \
sed -e 's,/service,/etc/service,g' -e 's,/command:,,g' $x > $x.new ; \
mv -f $x.new $x ; \
if [ "$ROCKCFG_PKG_DJB_LAYOUT" == "1" ]; then
hook_add premake 5 "for x in ./doc/debian/*; do \
if [ -f \$x ]; then \
echo Fixing \$x... ; \
sed -e 's,/var/service,/service,g' \$x > \$x.new ; \
mv -f \$x.new \$x ; \
fi ; \
done"
else
hook_add premake 5 "for x in ./doc/debian/*; do \
if [ -f \$x ]; then \
echo Fixing \$x... ; \
sed -e 's,/command:,,g' \$x > \$x.new ; \
mv -f \$x.new \$x ; \
fi ; \
done"
fi

+ 2
- 2
package/mnemoc/runit/runit.desc

@ -40,10 +40,10 @@
[L] OpenSource
[S] Stable
[V] 0.11.1
[V] 0.12.1
[P] O -1---5---9 700.000
[CV-URL] http://smarden.org/runit/install.html
[D] 310056452 runit-0.11.1.tar.gz http://smarden.org/runit/
[D] 2427812240 runit-0.12.1.tar.gz http://smarden.org/runit/

Loading…
Cancel
Save