From 665619eb42cbed1ce5d3d45fbd190e31bf249995 Mon Sep 17 00:00:00 2001 From: Daniel Stefan Haischt Date: Thu, 17 Aug 2006 16:35:22 +0000 Subject: bugfixing --- packages/freenas/pkg/freenas.inc | 22 +++++- packages/freenas/pkg/freenas_services.inc | 112 +++++++++++++++--------------- packages/freenas/www/disks_mount.php | 2 +- packages/freenas/www/services_afp.php | 2 +- packages/freenas/www/services_ftp.php | 4 +- 5 files changed, 80 insertions(+), 62 deletions(-) (limited to 'packages/freenas') diff --git a/packages/freenas/pkg/freenas.inc b/packages/freenas/pkg/freenas.inc index bb0685df..d00440a3 100644 --- a/packages/freenas/pkg/freenas.inc +++ b/packages/freenas/pkg/freenas.inc @@ -232,6 +232,8 @@ function oninstall_setup_config() { } function custom_php_install_command() { + global $g; + oninstall_copy_kernel_binaries(); oninstall_copy_misc_binaries(); adjust_package_contents(); @@ -240,27 +242,43 @@ function custom_php_install_command() { if (! file_exists("/usr/local/etc/rc.d")) mwexec("mkdir -p /usr/local/etc/rc.d"); + if (! file_exists("{$g['varrun_path']}/dbus")) + mkdir("{$g['varrun_path']}/dbus"); + + if (! file_exists("{$g['varrun_path']}/avahi-daemon")) + mkdir("{$g['varrun_path']}/avahi-daemon"); + rename("/usr/local/pkg/rc.freenas", "/usr/local/etc/rc.d/freenas.sh"); chmod ("/usr/local/etc/rc.d/freenas.sh", 0755); mwexec("ln -s /usr/local/etc/uams/uams_passwd.so /usr/local/etc/uams/uams_clrtxt.so"); mwexec("ln -s /usr/local/etc/uams/uams_dhx_passwd.so /usr/local/etc/uams/uams_dhx.so"); + /* hack cause I linked netatalk against db44 instead of db42 */ + mwexec("ln -s /usr/local/lib/libdb-4.4.so.0 /usr/local/lib/libdb-4.2.so.2"); } function custom_php_deinstall_command() { - global $config; + global $config, $g; oninstall_copy_kernel_binaries("deinstall"); oninstall_copy_misc_binaries("deinstall"); if (! file_exists("/usr/local/etc/rc.d")) - mwexec("rm -rf /usr/local/etc/rc.d"); } + mwexec("rm -rf /usr/local/etc/rc.d"); + + if (! file_exists("{$g['varrun_path']}/dbus")) + mwexec("rm -rf {$g['varrun_path']}/dbus"); + + if (! file_exists("{$g['varrun_path']}/avahi-daemon")) + mwexec("rm -rf {$g['varrun_path']}/avahi-daemon"); unlink_if_exists("/usr/local/etc/uams/uams_clrtxt.so"); unlink_if_exists("/usr/local/etc/uams/uams_dhx.so"); unlink_if_exists("/usr/local/etc/rc.d/freenas.sh"); + unlink_if_exists("/usr/local/lib/libdb-4.2.so.2"); unset($config['installedpackages']['freenas']); write_config(); conf_mount_ro(); +} ?> diff --git a/packages/freenas/pkg/freenas_services.inc b/packages/freenas/pkg/freenas_services.inc index 840a03c5..6020a4f6 100644 --- a/packages/freenas/pkg/freenas_services.inc +++ b/packages/freenas/pkg/freenas_services.inc @@ -195,7 +195,7 @@ EOD; /* Unmount filesystem if not booting mode*/ $sambaconf .= << 124 -backend = ${datarootdir}/wzdftpd/backends/libwzdpam.so +backend = /usr/local/share/wzdftpd/backends/libwzdplaintext.so > 124 +backend = /usr/local/share/wzdftpd/backends/libwzdpam.so max_ul_speed = 0 max_dl_speed = 0 @@ -581,17 +581,17 @@ site_vfsadd = +O site_vfsdel = +O [modules] -${datarootdir}/wzdftpd/modules/libwzd_debug.so = deny -${datarootdir}/wzdftpd/modules/libwzd_test.so = deny -${datarootdir}/wzdftpd/modules/libwzd_sfv.so = allow -${datarootdir}/wzdftpd/modules/libwzd_tcl.so = deny -${datarootdir}/wzdftpd/modules/libwzd_perl.so = deny +/usr/local/share/wzdftpd/modules/libwzd_debug.so = deny +/usr/local/share/wzdftpd/modules/libwzd_test.so = deny +/usr/local/share/wzdftpd/modules/libwzd_sfv.so = allow +/usr/local/share/wzdftpd/modules/libwzd_tcl.so = deny +/usr/local/share/wzdftpd/modules/libwzd_perl.so = deny EOD; if (empty($config['system']['zeroconf_disable'])) { $ftpconf .= << EOD; - + /* kill any running dbus daemon */ - sigkillbypid("{$g['varrun_path']}/dbus/dbus.pid", "TERM"); - + sigkillbypid("{$g['varrun_path']}/dbus/dbus.pid", "TERM"); + + unlink_if_exists("{$g['varrun_path']}/dbus/dbus.pid"); + /* kill any running avahi daemons */ - mwexec("/usr/local/sbin/avahi-daemon -k"); + mwexec("/usr/local/sbin/avahi-daemon -k"); if (isset($config['system']['zeroconf_disable'])) @@ -1239,7 +1239,7 @@ EOD; if (! file_exists("/usr/local/etc/avahi/services")) mwexec("mkdir -p /usr/local/etc/avahi/services"); - + if (isset($config['system']['webgui']['port'])) { $webservice = str_replace("@PORT@", $config['system']['webgui']['port'], @@ -1268,7 +1268,7 @@ EOD; $webservice = str_replace("@TXT_RECORDS@", "", $webservice); - + file_put_contents("/usr/local/etc/avahi/services/http.service", $webservice); } @@ -1295,7 +1295,7 @@ EOD; file_put_contents("/usr/local/etc/avahi/services/rsync.service", $rsyncservice); } - if (isset($config['sshd']['enable'])) { + if (isset($config['system']['enablesshd'])) { $sshservice = str_replace("@PORT@", "22", $service_template); @@ -1316,7 +1316,7 @@ EOD; /* NOP */ } - if (isset($freenas_config['samba']['enable'])) { + if (isset($freenas_config['samba']['enable'])) { $cifsservice = str_replace("@PORT@", "139", $service_template); @@ -1333,14 +1333,14 @@ EOD; file_put_contents("/usr/local/etc/avahi/services/cifs.service", $cifsservice); } - if (isset($freenas_config['nfs']['enable'])) { + if (isset($freenas_config['nfs']['enable'])) { /* If no share configured, exit */ if (!is_array($freenas_config['mounts']['mount'])) break; $a_mount = &$freenas_config['mounts']['mount']; - + foreach ($a_mount as $mount) { $sharename = str_replace(" ", "", $mount['sharename']); $sharename = strtolower($sharename); @@ -1363,11 +1363,11 @@ EOD; } - /* run dbus */ - mwexec("/usr/local/bin/dbus-daemon --system"); - - /* run avahi */ - mwexec("/usr/local/sbin/avahi-daemon -D"); + /* run dbus */ + mwexec("/usr/local/bin/dbus-daemon --system"); + + /* run avahi */ + mwexec("/usr/local/sbin/avahi-daemon -D"); if ($g['booting']) echo "done\n"; diff --git a/packages/freenas/www/disks_mount.php b/packages/freenas/www/disks_mount.php index 2a68a509..432eab34 100644 --- a/packages/freenas/www/disks_mount.php +++ b/packages/freenas/www/disks_mount.php @@ -172,7 +172,7 @@ echo $pfSenseHead->getHTML(); " width="17" height="17" border="0" alt="" /> - ');" title="" width="17" height="17" border="0" alt="" /> + ');" title="" width="17" height="17" border="0" alt="" /> diff --git a/packages/freenas/www/services_afp.php b/packages/freenas/www/services_afp.php index 64817c1a..521e1203 100644 --- a/packages/freenas/www/services_afp.php +++ b/packages/freenas/www/services_afp.php @@ -160,7 +160,7 @@ echo $pfSenseHead->getHTML(); - + diff --git a/packages/freenas/www/services_ftp.php b/packages/freenas/www/services_ftp.php index 88683e57..1d0ad6d4 100644 --- a/packages/freenas/www/services_ftp.php +++ b/packages/freenas/www/services_ftp.php @@ -165,7 +165,7 @@ if (! empty($_POST)) if (!file_exists($d_sysrebootreqd_path)) { /* nuke the cache file */ config_lock(); - services_ftpd_configure(); + services_wzdftpd_configure(); services_zeroconf_configure(); config_unlock(); } @@ -332,7 +332,7 @@ echo $pfSenseHead->getHTML();   - " /> + " /> -- cgit v1.2.3