Andy22 1 Posted March 9, 2014 Report Share Posted March 9, 2014 Hi,will post my findings to get plastic work under freeBSD in this thread. NOTE: I actually test it under nas4free inside a freeBSD 9.2-p3 jail.We use the "Server zip installer" from the "More installers" section, i will try get the .net4 version running later.[iMPORTANT]: Atm Plastic5 cant checkin to a freeBSD 9.2 x64 base system, the new freeBSD 10 x64 works, also 9.2 x32 works. (This means u cant use a 64 bit nas4free/freeNAS distro atm!) Check for updates to this problem: http://www.plasticscm.net/index.php?/topic/2144-plastic5-wont-work-under-freebsd-92-x64/ Preparations:The Plastic server needs at minimum "mono-basic" for .net 2.0, SQLite3 and zlib.1) We will install the latest mono via "pkg install mono", which is mono 3.2.8 atm. (Using "mono-basic" should also work.)2) We install SQLite3 via "pkg install sqlite3". Thats because SQLite3.dll is not embedded on a mono build inside the System.Data.SQLite.dll. see: https://system.data.sqlite.org/index.html/doc/trunk/www/build.wiki#mono3) Zlib is part of the freeBSD basesystem, so we don't need to add it. Problems: 1) Bash shell is used by the setup scripts, but is not a default shell for freeBSD 9.2, so u need to install it.FIX: "pkg install bash"2) The setup scripts expect bash under "/bin/" while it will be installed under "/usr/bin", so u need to relink or better change the scripts using it.FIX: Change the shell option to "#!/usr/bin/env bash" inside the scripts using bash in the "scripts" folder.NOTE: This should work under linux and freeBSD so @Plastic team plz change this. see http://stackoverflow.com/questions/5159711/what-is-the-proper-way-to-make-a-bash-script-portable-between-linux-and-freebsd3) The Mono install dir is also "/usr/local", which needs to-be set inside "scripts/mono_setup". (mono_base_path="/usr/local")FIX: Would be nice if the "genscripts.sh" would ask or search for the correct location, since the "README.txt" does not mention it. 3a) We can now run the "./scripts/genscripts.sh" script, so we can actually try starting the server. 4) We can now start the server via "./plasticd --console" for quick testing or "./plasticd --daemon" to run as daemon. 5) Starting plastic using "./plasticsd start" results into: Starting PlasticSCM server: Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file. Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file. Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file. Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file. The "/tmp/plasticd5.exe.lock" is created correctly and has a processid. It seems the check for the process is not working correctly and the script fails?FIX: edit "plasticsd" at "checkPid()" and replace: ps --pid $1 > /dev/null 2>&1 with: ps -p $1 > /dev/null 2>&1 NOTE: This should again work under freeBSD and linux, so @Plastic Team plz change this. Finally: We can now use the plasticsd script to control the server as expected and setup it as rc.d service. Conclusion: After a checkin and update operation the files where identically and the log revealed no errors. Performance was similar to my Windows tests, so except for the installation problems the Plastic5 server seems to run fine in a 32bit freeBSD 9.2, inside a Jail.NOTE: I use "security.jail.sysvipc_allowed" for the main nas4free base system via "sysctl.conf" and "allow.raw_sockets" for the Jail itself via TheBrig extension "additional jail options". thxAndy PS: Why i don't use a default linux distro u ask? Simple, chances are your Plastic server is also your file server, webDAV, webserver, s/ftp, backup server, DC/AD and here using a dedicated server distro like http://www.nas4free.org or http://www.freenas.org has many advantages and i like the freeBSD based more compared to the linux servers like http://www.openmediavault.org or http://www.zentyal.org . The bsd jails also allow for a extremely stable environment, since each application/service can run in its own virtual mini base system. On Linux http://www.docker.io looks very promising, but is not production rdy yet.If u can use ZFS filesystem, its also more mature/feature rich than ext4/btrfs on linux. NOTE: Only consider ZFS, if u have >=8 GB ram and a UPS, use the UFS filesystem on freeBSD otherwise. NOTE: One of the main difference between nas4free vs freeNAS is that freeNAS has samba4 so u can use it as DC, but otherwise both are very similar. Link to post Share on other sites
Andy22 1 Posted March 9, 2014 Author Report Share Posted March 9, 2014 Since we use the latest external SQLite3 version on freeBSD, we might as well replace the default shipped ancient 1.0.65 ADO provider with the current 1.0.91, which has countless bug/security fixes and should be more compatible with the latest SQLite3 we use for plastic. Guide on how to build and upgrade to the latest System.Data.SQLite.dll for mono. 1) Make sure u have a valid visual studio setup, i used VS express 2013. (i did not need the .net 2.0 sdk installed?)2) Download and extract the latest sqlite net sources https://system.data.sqlite.org/downloads/1.0.91.0/sqlite-netFx-source-1.0.91.0.zip3) open a normal cmd prompt and change into "setup"4) run the "set_2005.bat"5) run "SET MSBUILD_ARGS=/property:UseInteropDll=false /property:UseSqliteStandard=true /property:VisualStudioVersion=12.0" (replace the VisualStudioVersion with your installed VS version)6) run "build.bat ReleaseManagedOnly"7) copy the new build "\bin\2005\Release\bin\System.Data.SQLite.dll" into your freeBSD Plastic server dir. Strangely enough we don't need to change the "plasticd.exe.config" to rebind the new version? I have no clue why byeAndyPS: If u mainly operate on files <= ~100MB, u can now also use the new (3.7+) WAL journal mode see: http://www.sqlite.org/wal.html. Just change the db.conf connection string from "Journal Mode=Delete" to "Journal Mode=WAL". U might also want to add "Version=3;", to indicate the more recent SQLite3 db format version. Other options of interest are "Page Size=...." and "Cache Size=...", page size is set automatically to the cluster size of your filesystem, at the first creation of the db. U can override this to make sure its valid, while "Cache Size" sets the number of pages if positive or the size in kilobytes if a negative value is given. So "Cache Size=-8192" means ~8 MB cache size and "Cache Size=2000" means 2000 pages. See: http://www.sqlite.org/pragma.html#pragma_cache_size Link to post Share on other sites
Andy22 1 Posted September 18, 2014 Author Report Share Posted September 18, 2014 After checking the latest linux server build, i'm surprised and disappointed that none of the problems i reported here are fixed. The official site still reads: While we don’t provide official packages for OpenBSD or FreeBSD we have tested Plastic on both OSs. You can install it taking advantage of the ZIP packages that include the binaries in a platform agnostic way. I guess this test was done a couple of years ago, since you need to manually fix the install scripts to-be able to get PlasticSCM to work under FreeBSD. So if there is a compatibility fix that works on linux and freeBSD, why was it not applied yet? Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now