[Mono-dev] mono-service fix for 41: Syntax error: Bad fd number

Amc Gmail amc1999 at gmail.com
Mon Jun 11 20:30:35 EDT 2007

Current mono-service script doesn't work correctly on Ubuntu >= 6.10
It happens because first line is #!/bin/sh and line 40:
    .....something/mono-service.exe $args </dev/null >& /dev/null &
uses a bash-specific syntax and not work with default Ubuntu dash.

One of the possible ways to fix it is:
    ...line40.../mono-service.exe $args 0</dev/null 1>/dev/null 2>&1 &

And here is the diff for mono-1.2.4/scripts/mono-service.in (sorry,
not an svn diff):

diff mono-1.2.4/scripts/mono-service.in ../fixed/scripts/mono-service.in
<    exec @bindir@/@mono_interp@ $MONO_OPTIONS
@mono_instdir@/@framework_version@/mono-service.exe $args </dev/null
>& /dev/null &
>    exec @bindir@/@mono_interp@ $MONO_OPTIONS @mono_instdir@/@framework_version@/mono-service.exe $args 0</dev/null 1>/dev/null 2>&1 &

regards, amc

More information about the Mono-devel-list mailing list