# --- 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/runit.conf # ROCK Linux is Copyright (C) 1998 - 2006 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 https://www.rocklinux.org/ and the Documentation/TEAM # file for details. # # --- ROCK-COPYRIGHT-NOTE-END --- [ "$prefix" = usr ] && sbindir="$root/sbin" . $base/package/mnemoc/runit/djb-config admin $sbindir hook_add postmake 6 'pkg_runit_addservices' if ! pkginstalled daemontools; then hook_add postmake 7 ' \ [ "$pkg_djb_commanddir" ] && add_flist $pkg_djb_commanddir; \ [ "$pkg_djb_servicedir" ] && add_flist $pkg_djb_servicedir; \ [ "$pkg_djb_packagedir" ] && add_flist $pkg_djb_packagedir; ' fi pkg_runit_addservices() { local agettyargs speed # main scripts and virtual consoles #if [ ! -f $sysconfdir/1 ]; then echo "Creating main scripts and virtual consoles..." mkdir -p $sysconfdir 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#vc/}/run #!/bin/sh exec /sbin/agetty $agettyargs $speed $i linux EOT cat << EOT > $sysconfdir/getty-${i#vc/}/finish #!/bin/sh exec ${pkg_djb_commanddir#$root}/utmpset -w $i EOT chmod 755 $sysconfdir/getty-${i#vc/}/{run,finish} done #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/ done # init at /sbin if [ ${pkg_djb_commanddir} != $sbindir ]; then echo "Copying init files to /sbin..." cp -vf ${pkg_djb_commanddir}/runit* $sbindir/ fi # TODO: if not sysvinit, link runit-init to init. # Emulate daemontools if not present if ! pckgcheck daemontools X; then echo "Emulate functionality of daemontools with chpst." for x in softlimit envdir envuidgid pgrphack setlock setuidgid; do ln -sfv chpst $pkg_djb_commanddir/$x done fi } 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 -i -e 's,/var/service,/service,g' \$x ; \ fi ; \ done" else hook_add premake 5 "for x in ./doc/debian/*; do \ if [ -f \$x ]; then \ echo Fixing \$x... ; \ sed -i -e 's,/command:,,g' \$x ; \ fi ; \ done" fi