@@ -7,12 +7,18 @@
77
88STATEDIR=/var/run/nix-services
99RCDIR=/etc/rc.d/
10+NIXPKGS=@nixpkgs@
1011
1112## resolve $deps to real start/stop scripts first
1213
1314start_deps() {
1415 for i in $deps; do
15− $i start
16+ name=`$i/control name`
17+ if ! test -a $RCDIR/$name; then
18+ echo "blaat"
19+ fi
20+
21+ $i/control start
1622 RETVAL=$?
1723 if test $RETVAL != 0; then
1824 exit $RETVAL
@@ -23,7 +29,16 @@ start_deps() {
2329start_softdeps() {
2430 for i in $softdeps; do
2531 echo $i
26− $i start
32+
33+ name=`$i/control name`
34+ if ! test -a "$RCDIR/$name"; then
35+ echo $RCDIR/$name $i
36+ @nix@/bin/nix-env -p $RCDIR/$name -i $i
37+ fi
38+
39+ $i/control start
40+
41+ #$i start
2742 RETVAL=$?
2843 if test $RETVAL != 0; then
2944 continue
@@ -34,7 +49,7 @@ start_softdeps() {
3449start() {
3550 # are we already running?
3651 # if so, exit with code 0
37− if test -a $STATDIR/$prog; then
52+ if test -a $STATEDIR/$prog; then
3853 exit 0
3954 fi
4055 # if not, continue