Index: z3950-daemon-launch.sh
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/z3950-daemon-launch.sh,v
retrieving revision 1.3
diff -r1.3 z3950-daemon-launch.sh
1c1
< #!/bin/sh
---
> !/bin/sh
38c38,83
< su -s /bin/sh -c $KohaZ3950Shell - $RunAsUser &
---
> RunCommand="su -s /bin/sh -c $KohaZ3950Shell - $RunAsUser"
> 
> #----------------------------
> # Now we work around  nonexistent login shells as best we can
> 
> ApacheShell=$( grep $RunAsUser /etc/passwd | awk -F ':' '{print($7)}' )
> 
> if [ $ApacheShell=="/dev/null" ] 
> then
>   SetUidGid=$(which setuidgid)
>   if [ ! -x $SetUidGid ]
>   then
>      echo "ERROR: Cannot run z3950-daemon-shell.sh as $RunAsUser"
> 	 exit 1
>   else
>      RunCommand="setuidgid $RunAsUser $KohaZ3950Shell"
>   fi
> fi    
> 
> 
> if [ $ApacheShell=="/bin/false" ] 
> then
>   SetUidGid=$(which setuidgid)
>   if [ ! -x $SetUidGid ]
>   then
>      echo "ERROR: Cannot run z3950-daemon-shell.sh as $RunAsUser"
> 	 exit 1
>   else
>      RunCommand="setuidgid $RunAsUser $KohaZ3950Shell"
>   fi
> fi    
> 
> if [ $ApacheShell=="/sbin/nologin" ] 
> then
>   SetUidGid=$(which setuidgid)
>   if [ ! -x $SetUidGid ]
>   then
>      echo "ERROR: Cannot run z3950-daemon-shell.sh as $RunAsUser"
> 	 exit 1
>   else
>      RunCommand="setuidgid $RunAsUser $KohaZ3950Shell"
>   fi
> fi    
> 
> $RunCommand &
> 
