I'm trying to write a check script for a service I've got installed. The Check script, when run by root returns an exit code of 0 on success and 1 on failure and does not output anything. When running "sv check mythbackend", it give me some errors, even though successful: /bin/grep: write error: Bad file descriptor ok: run: mythbackend: (pid 19728) 2287s When there is a problem, it will print the bad file descriptor error a few times per second for 7 seconds. The script is below. It seems that the check script is run in a more restrictive environment, but I can't find any documentation about this. Can anybody tell me why it works as root, but not when called through sv? check script (-rwx------ 1 root root 82 2010-11-07 14:34 check) #!/bin/bash /usr/bin/curl -s http://localhost:6544 | /bin/grep -q "MythTV Status"