3
0
Fork 0
forked from mirrors/nixpkgs

more script work. Now what we need is:

* generic functions to register with the system, good for "weak dependencies"

svn path=/nixpkgs/trunk/; revision=5009
This commit is contained in:
Armijn Hemel 2006-03-08 19:38:12 +00:00
parent fe46e2a9b0
commit 9a198b5192
8 changed files with 160 additions and 2 deletions

View file

@ -0,0 +1,10 @@
source $stdenv/setup
ensureDir $out
sed -e "s^@bash\@^$bash^g" \
-e "s^@dhcp\@^$dhcp^g" \
-e "s^@nettools\@^$nettools^g" \
< $script > $out/$nicename
chmod +x $out/$nicename

View file

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

View file

@ -0,0 +1,58 @@
#!@bash@/bin/bash
#
# Dummy init file for network, hacketyhack!
#
# chkconfig: 2345 55 25
# description: OpenSSH server daemon
#
# processname: sshd
# source function library
#. @initscripts@/etc/rc.d/init.d/functions
# pull in sysconfig settings
#[ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd
RETVAL=0
prog="network"
start()
{
# just do networking
echo -n $"Starting $prog:"
@dhcp@/sbin/dhclient
}
stop()
{
echo -n $"Stopping $prog:"
}
reload()
{
start
stop
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
reload)
reload
;;
status)
echo "all OK"
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
RETVAL=1
esac
exit $RETVAL

View file

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

View file

@ -2,6 +2,7 @@
stdenv.mkDerivation {
name = "ssh-script-0.0.1";
nicename = "sshd";
server = "ssh";
builder = ./builder.sh ;
inherit bash ssh initscripts coreutils;

View file

@ -0,0 +1,10 @@
source $stdenv/setup
ensureDir $out
sed -e "s^@bash\@^$bash^g" \
-e "s^@syslog\@^$syslog^g" \
-e "s^@nicename\@^$nicename^g" \
< $script > $out/$nicename
chmod +x $out/$nicename

View file

@ -0,0 +1,10 @@
{stdenv, bash, syslog}:
stdenv.mkDerivation {
name = "syslog-script-0.0.1";
server = "syslog";
nicename = "syslog";
builder = ./builder.sh ;
inherit bash syslog;
script = [./syslog];
}

View file

@ -0,0 +1,59 @@
#!@bash@/bin/bash
#
# Dummy init file for syslog, hacketyhack!
#
# chkconfig: 2345 55 25
# description: OpenSSH server daemon
#
# processname: sshd
# source function library
#. @initscripts@/etc/rc.d/init.d/functions
# pull in sysconfig settings
#[ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd
RETVAL=0
prog=@nicename@
start()
{
# just do networking
echo -n $"Starting $prog:"
@syslog@/usr/sbin/syslogd
@syslog@/usr/sbin/klogd
}
stop()
{
echo -n $"Stopping $prog:"
}
reload()
{
start
stop
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
reload)
reload
;;
status)
echo "all OK"
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
RETVAL=1
esac
exit $RETVAL