From b6d85b04286d30498a11aaac36e75032b1e72801 Mon Sep 17 00:00:00 2001 From: jonas Date: Sat, 10 Jun 2006 18:18:37 +0000 Subject: Added all work so far... git-svn-id: svn+ssh://xayide/home/jonas/private_svn/fleshybrid/trunk@2 8f53b18a-e215-0410-8885-9f593d34873e --- tweaks/usr/local/sbin/policy-rc.d | 65 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 tweaks/usr/local/sbin/policy-rc.d (limited to 'tweaks/usr/local') diff --git a/tweaks/usr/local/sbin/policy-rc.d b/tweaks/usr/local/sbin/policy-rc.d new file mode 100755 index 0000000..b89a676 --- /dev/null +++ b/tweaks/usr/local/sbin/policy-rc.d @@ -0,0 +1,65 @@ +#!/bin/sh + +# $Id: policy-rc.d,v 1.3 2006/04/22 16:04:55 jonas Exp $ +# +# Copyright © 2006 Jonas Smedegaard +# Description: Suppress system V scripts if invoked within a chroot. +# +# 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, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# Policy-rc.d is mentioned in manpage invoke-rc.d(8) and documented at +# http://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt + +set -e + +PRG=`basename $0` + +TEMP=`getopt -s sh --long list,quiet -n "$PRG" -- "$@"` +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi +eval set -- "$TEMP" + +quiet="" +list="" +while true ; do + case "$1" in + --quiet) quiet="1" ; shift ;; + --list) list="1" ; shift ;; + --) shift ; break ;; + *) echo "Internal error!" ; exit 1 ;; + esac +done +initscript="$1" +actions="$2" +runlevel="$3" + +if [ "$list" ]; then + cat <&2 "Chroot environment detected, suppressing sysV script." + fi + exit 101 +fi + +exit 0 -- cgit v1.2.3