From 38ac447b0cd9362f60cc73652defa88f9871bc24 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 21 Nov 2010 17:55:30 -0500 Subject: Ensue unbound user exists --- config/unbound/unbound.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc index 2b3b30b0..6b7080f4 100644 --- a/config/unbound/unbound.inc +++ b/config/unbound/unbound.inc @@ -37,9 +37,13 @@ function unbound_initial_setup() { $config['installedpackages']['unbound']['config'] = array(); $unbound_config = &$config['installedpackages']['unbound']['config'][0]; - + + // Ensure Unbound user exists + exec("/usr/sbin/pw useradd unbound"); + // Setup unbound mwexec("/bin/mkdir -p /usr/local/etc/unbound /usr/local/etc/unbound/dev"); + @chown("/usr/local/etc/unbound/.", "unbound"); @touch("/usr/local/etc/unbound/root.hints"); @touch("/usr/local/etc/unbound/root-trust-anchor"); @chown("/usr/local/etc/unbound/root-trust-anchor", "unbound"); @@ -64,6 +68,8 @@ function unbound_initial_setup() { unbound_resync_config(); unbound_keys_setup(); + exec("/usr/sbin/chown unbound:wheel /usr/local/etc/unbound/*"); + // Write out the XML config write_config(); @@ -399,6 +405,9 @@ function unbound_uninstall() { mwexec("rm -rf /usr/local/etc/unbound"); mwexec("rm -f /usr/local/etc/rc.d/unbound.sh"); + // Remove unbound user + exec("/usr/sbin/pw userdel unbound"); + conf_mount_ro(); } -- cgit v1.2.3