adapt files so that "networking" now also work with our new scheme

svn path=/nixpkgs/trunk/; revision=5049
This commit is contained in:
Armijn Hemel 2006-03-17 14:16:11 +00:00
parent 7c50890ebe
commit 35e30e7797
6 changed files with 21 additions and 13 deletions

View File

@ -4,7 +4,8 @@ ensureDir $out
sed -e "s^@bash\@^$bash^g" \
-e "s^@dhcp\@^$dhcp^g" \
-e "s^@initscripts\@^$initscripts^g" \
-e "s^@nettools\@^$nettools^g" \
< $script > $out/$nicename
< $script > $out/control
chmod +x $out/$nicename
chmod +x $out/control

View File

@ -1,10 +1,10 @@
{stdenv, bash, nettools, dhcp, key ? null}:
{stdenv, bash, nettools, dhcp, key ? null, initscripts}:
stdenv.mkDerivation {
name = "network-script-0.0.1";
server = "network";
nicename = "networking";
builder = ./builder.sh ;
inherit bash nettools dhcp;
inherit bash nettools dhcp initscripts;
script = [./network];
}

View File

@ -8,7 +8,7 @@
# processname: sshd
# source function library
#. @initscripts@/etc/rc.d/init.d/functions
source @initscripts@/functions
# pull in sysconfig settings
#[ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd
@ -16,14 +16,14 @@
RETVAL=0
prog="network"
start()
startService()
{
# just do networking
echo -n $"Starting $prog:"
@dhcp@/sbin/dhclient
}
stop()
stopService()
{
echo -n $"Stopping $prog:"
}
@ -49,10 +49,13 @@ case "$1" in
reload
;;
status)
echo "all OK"
status
;;
name)
name
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
echo $"Usage: $0 {start|stop|restart|reload|status|name}"
RETVAL=1
esac
exit $RETVAL

View File

@ -14,11 +14,14 @@ NIXPKGS=@nixpkgs@
start_deps() {
for i in $deps; do
name=`$i/control name`
if ! test -a $RCDIR/$name; then
echo "blaat"
if ! test -a "$RCDIR/$name"; then
echo $RCDIR/$name $i
@nix@/bin/nix-env -p $RCDIR/$name -i $i
fi
$i/control start
RETVAL=$?
if test $RETVAL != 0; then
exit $RETVAL
@ -38,7 +41,6 @@ start_softdeps() {
$i/control start
#$i start
RETVAL=$?
if test $RETVAL != 0; then
continue
@ -54,7 +56,7 @@ start() {
fi
# if not, continue
# launch all hard dependencies
#start_deps
start_deps
# launch all preferred dependencies
echo "softdeps" $softdeps
start_softdeps

View File

@ -7,6 +7,7 @@ sed -e "s^@bash\@^$bash^g" \
-e "s^@initscripts\@^$initscripts^g" \
-e "s^@coreutils\@^$coreutils^g" \
-e "s^@softdeps\@^$softdeps^g" \
-e "s^@deps\@^$deps^g" \
< $script > $out/control
chmod +x $out/control

View File

@ -22,6 +22,7 @@ RETVAL=0
prog="sshd"
softdeps="@softdeps@"
deps="@deps@"
# Some functions to make the below more readable
KEYGEN=@sshd@/bin/ssh-keygen