[Mono-aspnet-list] could not execute linux shell script from asp.net application

Robert Jordan robertj at gmx.net
Fri Jun 12 07:49:48 EDT 2009


RaviThapliyal wrote:
> Is there a way out to execute a shell script (created in linux) from asp.net
> application for e.g. i want to create file called "foo.txt" by calling a
> shell script file
> 
> my asp.net(C#) code is:
>          
>             string batchFile = "/srv/www/htdocs/helloworld.sh";
>             ProcessStartInfo startInfo = new ProcessStartInfo(batchFile);
>             Process.Start(startInfo);
>           
> where as the script file(helloworld.sh) contains
> 
>             <b>#!/bin/bash
>             cat> foo.txt
> 

What exceptions did you get?

Accessing files from ASP.NET applications hosted in mod_mono
requires proper access rights because mod_mono is likely running
under a limited apache account (usually "wwwrun").

BTW, "cat> foo.txt" will block forever.

Robert



More information about the Mono-aspnet-list mailing list