I have a daemon I have written using Python. When it is running, it has a PID file located at /tmp/filename.pid. If the daemon isn\'t running then PID file doesn\'t exist.>
If it is bash scripting you are wondering about, something like this would work:
if [ ! -f "$FILENAME" ]; then python daemon.py restart fi
A better option may be to look into lockfile