From e8ddb6fd2d483b8e96a8230252e7f5cb0e1e5991 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 14 Jan 2008 11:24:36 +0000 Subject: [PATCH] Samba service; httpd/xfs dependencies changed to know about gw6c.autorun option. svn path=/nixos/trunk/; revision=10140 --- upstart-jobs/httpd.nix | 2 +- upstart-jobs/samba.nix | 22 +++++++++++++++++----- upstart-jobs/smb.conf | 10 ++++++++++ upstart-jobs/xfs.nix | 2 +- 4 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 upstart-jobs/smb.conf diff --git a/upstart-jobs/httpd.nix b/upstart-jobs/httpd.nix index 20d0f834facf..0e1703b08ac4 100644 --- a/upstart-jobs/httpd.nix +++ b/upstart-jobs/httpd.nix @@ -19,7 +19,7 @@ let enableSSL = false; extraDirectories = cfg.extraDirectories + extraConfig; - startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces"; + startingDependency = if config.services.gw6c.enable && config.services.gw6c.autorun then "gw6c" else "network-interfaces"; webServer = import ../../services/apache-httpd { inherit (pkgs) apacheHttpd coreutils; diff --git a/upstart-jobs/samba.nix b/upstart-jobs/samba.nix index fa4cbf70859e..08af9dec747d 100644 --- a/upstart-jobs/samba.nix +++ b/upstart-jobs/samba.nix @@ -4,7 +4,9 @@ let user = "smbguest"; group = "smbguest"; - + + smbConfig = ./smb.conf ; + in { @@ -31,13 +33,23 @@ stop on network-interfaces/stop start script - ${samba}/sbin/nmbd -D & - ${samba}/sbin/smbd -D & - ${samba}/sbin/winbindd -B & + if ! test -d /home/smbd ; then + mkdir -p /home/smbd + chown ${user} /home/smbd + chmod a+rwx /home/smbd + fi + + if ! test -d /var/samba ; then + mkdir -p /var/samba/locks /var/samba/cores/nmbd /var/samba/cores/smbd /var/samba/cores/winbindd + fi + + ${samba}/sbin/nmbd -D -s ${smbConfig} & + ${samba}/sbin/smbd -D -s ${smbConfig} & + ${samba}/sbin/winbindd -B -s ${smbConfig} & end script -respawn ${samba}/sbin/nmbd -D &; ${samba}/sbin/smbd -D &; ${samba}/sbin/winbindd -B & +respawn ${samba}/sbin/nmbd -D -s ${smbConfig} &; ${samba}/sbin/smbd -D -s ${smbConfig} &; ${samba}/sbin/winbindd -B & "; diff --git a/upstart-jobs/smb.conf b/upstart-jobs/smb.conf new file mode 100644 index 000000000000..69d5b41f7069 --- /dev/null +++ b/upstart-jobs/smb.conf @@ -0,0 +1,10 @@ +[global] + workgroup = Users + security = share + server string = %h + comment = Samba + local master = no +[default] + path = /home/smbd + read only = no + guest ok = yes diff --git a/upstart-jobs/xfs.nix b/upstart-jobs/xfs.nix index 20975622ccc0..8b9b795d1957 100644 --- a/upstart-jobs/xfs.nix +++ b/upstart-jobs/xfs.nix @@ -3,7 +3,7 @@ }: let configFile = ./xfs.conf; - startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces"; + startingDependency = if config.services.gw6c.enable && config.services.gw6c.autorun then "gw6c" else "network-interfaces"; in rec { name = "xfs";