fix some brainfarts

svn path=/nixpkgs/trunk/; revision=5021
This commit is contained in:
Armijn Hemel
2006-03-10 13:32:54 +00:00
parent 742c1ef85e
commit 6562861ba4
6 changed files with 45 additions and 15 deletions

View File

@@ -0,0 +1,5 @@
source $stdenv/setup
ensureDir $out
cp $functions $out/$nicename

View File

@@ -0,0 +1,9 @@
{stdenv}:
stdenv.mkDerivation {
name = "generic-server-script-0.0.1";
server = "generic";
nicename = "functions";
builder = ./builder.sh ;
functions = [./functions];
}

View File

@@ -11,31 +11,36 @@ RCDIR=/etc/rc.d/
## resolve $deps to real start/stop scripts first
start_deps() {
for i in $deps
for i in $deps; do
$i start
RETVAL=$?
if test $RETVAL != 0; then
exit $RETVAL
fi
done
}
start_softdeps() {
for i in $softdeps
for i in $softdeps; do
$i start
RETVAL=$?
if test $RETVAL != 0; then
continue
fi
done
}
start() {
# are we already running?
# if so, exit with code 0
if test -a $STATDIR/$prog = 1; then
if test -a $STATDIR/$prog; then
exit 0
fi
# if not, continue
# launch all hard dependencies
start_deps
#start_deps
# launch all preferred dependencies
start_softdeps
#start_softdeps
# launch our own program
}
@@ -43,6 +48,7 @@ stop() {
# are we running? If so, then stop, otherwise, do nothing...
if test -a $STATDIR/$prog = 0; then
exit 0
fi
# stop our own program
}
@@ -53,3 +59,12 @@ register() {
unregister() {
rm $STATEDIR/$prog
}
status() {
# are we running? If so, report
if test -a $STATDIR/$prog; then
echo "running"
else
echo "stopped"
fi
}