we are trying to implement an application using the Service Layer Pattern cause our application needs to connect to other multiple applications too, and googling on the web, we found this link of a demonstrative graphic for the "right" way of apply the pattern:

martinfowler.com - Service Layer Pattern

But now we have a question: what if our system needs to implement some business logic, only for our application (like some maintenance data for the system itself) that we don't need to share with other systems. Based on this graphic:



As it seems, it will be unnecesary to implement a service layer just for that; it will be more practical to avoid the service layer, and just go from User Interface to the Business Layer (for example). What should be the right way in this case to implement the Service Layer Pattern? What do you suggest us for a scenario like the one I told you?

Thanks in advance.


Question: Syntax error: word unexpected on io redirection on file descriptor ≥10
Answer: On second thought, perhaps a more simple approach than my original answer (which I have reproduced below since that is what was originally accepted) is to change the file descriptor from 200 to something that is &lt;9. For example, 5. So, change 
all three instances of 200 in your script to 5:

#!/bin/sh
case "$IFACE" in
    lo)
        # The loopback interface does not count.
        # only run when some other interface comes up
        exit 0
        ;;
    *)
        ;;
esac

(
flock -e 5

FLAGFILE=/var/run/cyvo-auto-started

if [ -e $FLAGFILE ]; then
    exit 0
else
    touch $FLAGFILE
fi

# Launch CyVo without the lock and as cyvo user
flock -u 5
sudo -u cyvo /usr/local/bin/cyvo-launch.sh

) 5&gt;/var/lock/cyvo-autostart-lock




Original answer:

Either because sh can't deal with file descriptors >9 as @GlennJackman suggested or for some other peculiarity, your script doesn't work with sh (which is dash on Debian-based distributions). I tried with bash and it worked fine so just use bash instead. Change the first line from 

#!/bin/sh


to

#!/bin/bash


The script should then work as expected.