mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
3.3 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/mnemoc/runit/runit.conf
  9. # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. [ "$prefix" = usr ] && sbindir="$root/sbin"
  23. . $base/package/mnemoc/runit/djb-config admin $sbindir
  24. hook_add postmake 6 'pkg_runit_addservices'
  25. if ! pkginstalled daemontools; then
  26. hook_add postmake 7 ' \
  27. [ "$pkg_djb_commanddir" ] && add_flist $pkg_djb_commanddir; \
  28. [ "$pkg_djb_servicedir" ] && add_flist $pkg_djb_servicedir; \
  29. [ "$pkg_djb_packagedir" ] && add_flist $pkg_djb_packagedir; '
  30. fi
  31. pkg_runit_addservices() {
  32. local agettyargs speed
  33. # main scripts and virtual consoles
  34. #if [ ! -f $sysconfdir/1 ]; then
  35. echo "Creating main scripts and virtual consoles..."
  36. mkdir -p $sysconfdir
  37. cp -vf ./doc/debian/[123] $sysconfdir/
  38. cp -vf ./doc/debian/ctrlaltdel $sysconfdir/
  39. chmod 744 $sysconfdir/[123]
  40. chmod 744 $sysconfdir/ctrlaltdel
  41. for i in console 1 2 3 4 5 6; do
  42. if [ "$i" == "console" ]; then
  43. echo "Creating getty $i..."
  44. speed=9600
  45. else
  46. echo "Creating getty tty$i..."
  47. i="vc/$i"
  48. speed=38400
  49. fi
  50. mkdir -p $sysconfdir/getty-${i#vc/}
  51. if [ "$i" == "console" -o "$i" == "vc/1" ]; then
  52. agettyargs='-L -i -I '"'"'\012\015\012Maintenance Console:\012'"'"
  53. else
  54. agettyargs='-f /etc/issue.ansi'
  55. fi
  56. cat << EOT > $sysconfdir/getty-${i#vc/}/run
  57. #!/bin/sh
  58. exec /sbin/agetty $agettyargs $speed $i linux
  59. EOT
  60. cat << EOT > $sysconfdir/getty-${i#vc/}/finish
  61. #!/bin/sh
  62. exec ${pkg_djb_commanddir#$root}/utmpset -w $i
  63. EOT
  64. chmod 755 $sysconfdir/getty-${i#vc/}/{run,finish}
  65. done
  66. #fi
  67. # getties to svscan
  68. echo "Make getties available to svscan..."
  69. for i in 1 2 3 4 5 6; do
  70. ln -sfv ${sysconfdir#$root}/getty-$i $pkg_djb_servicedir/
  71. done
  72. # init at /sbin
  73. if [ ${pkg_djb_commanddir} != $sbindir ]; then
  74. echo "Copying init files to /sbin..."
  75. cp -vf ${pkg_djb_commanddir}/runit* $sbindir/
  76. fi
  77. # TODO: if not sysvinit, link runit-init to init.
  78. # Emulate daemontools if not present
  79. if ! pckgcheck daemontools X; then
  80. echo "Emulate functionality of daemontools with chpst."
  81. for x in softlimit envdir envuidgid pgrphack setlock setuidgid;
  82. do
  83. ln -sfv chpst $pkg_djb_commanddir/$x
  84. done
  85. fi
  86. }
  87. if [ "$ROCKCFG_PKG_DJB_LAYOUT" == "1" ]; then
  88. hook_add premake 5 "for x in ./doc/debian/*; do \
  89. if [ -f \$x ]; then \
  90. echo Fixing \$x... ; \
  91. sed -i -e 's,/var/service,/service,g' \$x ; \
  92. fi ; \
  93. done"
  94. else
  95. hook_add premake 5 "for x in ./doc/debian/*; do \
  96. if [ -f \$x ]; then \
  97. echo Fixing \$x... ; \
  98. sed -i -e 's,/command:,,g' \$x ; \
  99. fi ; \
  100. done"
  101. fi