Hey y'all, I posted about the relay a couple days back - I've got my device working on the breadboard as a command line app that simple activates the octocoupler. Now, I want to wrap that little bit of functionality into a daemon.
Short version of the question: What is the simplest way to create a daemon in the Pi?
Relevant info: I mainly have used Python up to now, but trying to make my Python script in my last project became a nightmare. It occurs to me, though, that I can simply "black box" the Python code and write the daemon in PHP, or whatever other language "daemonizes" more easily than Python. But then I just figured, surely someone has made some Python code into a daemon on the Pi by now, so... I'm not sure which order of ignorance I'm at, but it's annoying.
Events on which I want the daemon to activate its pin:
-check the internet connection every five minutes - if no connection found, activate.
-eventually I'm going to add a GSM shield to the Pi, and have it send out a text message before activating the relay, to give me the option to shut off the daemon if I know that something else is going on.
-listen on a port (or a http server, whatever is most easy/efficient - or is that the same thing?) for a signal to do the same.
-listen on another IO pin (a switch on my desk) to do the same.
So, to recap: I want to make a daemon that manages turning on Pin 17, that I can activate from elsewhere on the network, and that automatically monitors my internet connection. I know Python and PHP, but am confident that I can learn any high-level language you can throw at me, if it results in my being able to daemonize my little snippet of Python code, which so far as I know is the only way to work with the GPIO.