[imps] setting up, and keeping up, the html5 validator.nu java servlet

john gale john at smadness.com
Thu Aug 26 14:40:36 PDT 2010


On Aug 26, 2010, at 1:27 AM, Henri Sivonen wrote:

>> The problem I'm running into is that the servlet is quitting itself,
>> possibly because of the result of not having stdin, or having
>> unexpected stdin. I'm not familiar with enough with stdin and/or what
>> the servlet is expecting. I tried the equivalent of </dev/null but
>> that doesn't seem to fix the problem. launchd itself essentially
>> doesn't allow for a stdin of "&-" so I'm looking for other
>> alternatives. Do you have any ideas? Or possibly ways of modding the
>> servlet to continue running despite receiving any stdin?
> 
> If you specify a stop port for the servlet (as the last command line parameter for nu.validator.servlet.Main or via --control-port= to build.py [undocumented, oops, sorry]), it doesn't try to read from stdin. When anything connects to the control port, the process shuts itself down, so be sure to protect the port in your firewall.


Yes, that solved it, thanks.

For posterity, pasted below is my Mac OS X launchd plist that I shoved into /Library/LaunchDaemons/com.example.tools.html5validator.plist

thanks again for your help,

	~ john



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>Label</key>
   <string>com.example.tools.html5validator</string>
   <key>EnvironmentVariables</key>
   <dict>
      <key>JAVA_HOME</key>
      <string>/System/Library/Frameworks/JavaVM.framework/Home</string>
   </dict>
   <key>WorkingDirectory</key>
   <string>/Users/john/Sites/validator/html5checker</string>
   <key>ProgramArguments</key>
   <array>
      <string>python</string>
      <string>build/build.py</string>
      <string>--control-port=8889</string>
      <string>run</string>
   </array>
   <key>StandardOutPath</key>
   <string>/Library/Logs/html5validator.log</string>
   <key>StandardErrorPath</key>
   <string>/Library/Logs/html5validator.log</string>
   <key>UserName</key>
   <string>john</string>
   <key>KeepAlive</key>
   <true/>
</dict>
</plist>




More information about the Implementors mailing list