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" \ sed -e "s^@bash\@^$bash^g" \
-e "s^@dhcp\@^$dhcp^g" \ -e "s^@dhcp\@^$dhcp^g" \
-e "s^@initscripts\@^$initscripts^g" \
-e "s^@nettools\@^$nettools^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 { stdenv.mkDerivation {
name = "network-script-0.0.1"; name = "network-script-0.0.1";
server = "network"; server = "network";
nicename = "networking"; nicename = "networking";
builder = ./builder.sh ; builder = ./builder.sh ;
inherit bash nettools dhcp; inherit bash nettools dhcp initscripts;
script = [./network]; script = [./network];
} }

View File

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

View File

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

View File

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

View File

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