In my webapp i do the below. I know its correct because i tried 1) dumping start_sz to a text file 2) su www-data 3) copy/paste the extract string and it worked.
var start_sz = string.Format(@"bash -c 'ln ""{2}/{0}"" ""{2}/{1}""'", fn, newfn, System.IO.Directory.GetCurrentDirectory());
Process.Start(start_sz);
I get the exception below so with reasoning above i believe its saying bash cannot be found.
Cannot find the specified file
at System.Diagnostics.Process.Start_shell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in :0
at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in :0
at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) [0x00000] in :0
at System.Diagnostics.Process.Start (System.String fileName) [0x00000] in :0
at MySite.QueueManager.MakeLink (System.String fn) [0x00000] in :0
at MySite.QueueManager.ImageQueue2 () [0x00000] in :0
at MySite.QueueManager.ImageQueue () [0x00000] in :0
So, how do i fix this? basically i need to create a hardlink (soft is ok too) at run time in my asp.net app.
I thought maybe i need the full bash path so i tried /bin/bash -c
however that didn't work either.