I haven't done this, but you should be able to build a service using GPIO by following something similar to what was said here: GPIO interface
I haven't done this, but you should be able to build a service using GPIO by following something similar to what was said here: GPIO interface