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:
parent
fe46e2a9b0
commit
9a198b5192
10
pkgs/servers/network-script/builder.sh
Normal file
10
pkgs/servers/network-script/builder.sh
Normal 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
|
10
pkgs/servers/network-script/default.nix
Normal file
10
pkgs/servers/network-script/default.nix
Normal 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];
|
||||
}
|
58
pkgs/servers/network-script/network
Executable file
58
pkgs/servers/network-script/network
Executable 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
|
|
@ -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
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
stdenv.mkDerivation {
|
||||
name = "ssh-script-0.0.1";
|
||||
nicename = "sshd";
|
||||
server = "ssh";
|
||||
builder = ./builder.sh ;
|
||||
inherit bash ssh initscripts coreutils;
|
||||
|
|
10
pkgs/servers/syslog-script/builder.sh
Normal file
10
pkgs/servers/syslog-script/builder.sh
Normal 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
|
10
pkgs/servers/syslog-script/default.nix
Normal file
10
pkgs/servers/syslog-script/default.nix
Normal 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];
|
||||
}
|
59
pkgs/servers/syslog-script/syslog
Executable file
59
pkgs/servers/syslog-script/syslog
Executable 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
|
Loading…
Reference in a new issue