Agree w/Paul - crontab is for periodically running things, not to start a daemon on system startup.
To add a little bit more to what he mentioned, you may want to have a script that accepts a parameter indicating if it's "start", "stop" or "restart" (e.g. stop then start) for the daemon. Then within the /etc/init.d/ dir you put your script. It must have a standard LSB header and you run a command (see 2nd link) so the system knows how to connect all the parts. This way for shutdown (or restart) your clock code can accept a shutdown request (in your clock program C code catch a SIGTERM or other 'signal') and gracefully put any GPIO pins to a safe state before exiting. Restart is handy after you've swapped in a new program version. For that once in a blue moon instance when your program won't shut down gracefully, you can in your script also code a "kill" section that sends a SIGKILL to your program. In the script you also choose at what run-level you want the clock program to run. Typically, that would be 2, 3 & 5. See http://www.tldp.org/LDP/sag/html/run-levels-intro.html for run-level info, which also talks a little about the /etc/init.d/ A decent RPi example & explanation of what's needed with some shell start/stop code is here: http://raspberrywebserver.com/serveradmin/run-a-script-on-start-up.html I haven't verified it works, but the shell scripting looks OK from my Red Hat perspective. Good luck and have fun! - Steve -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Paul Andrews Sent: Tuesday, June 20, 2017 8:08 AM To: neonixie-l Subject: Re: [neonixie-l] Re: Raspberry PI controlled Nixie display Good news. I had wondered about using a PI myself but was concerned with lack of realtimeness. BTW, in regular UNIX you would set your app up as a demon that runs at boot up. Crontab would not be the way to go. There should be a bunch of stuff in /etc/init.d or /etc/initd or something like that. You'll have to google the details, you should be able to specify at what stage in the boot process it gets run and as what user. - Paul -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/6ef0cef0-e433-4ecf-839a-fbd8f98838dd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/009101d2ea32%249595e9e0%24c0c1bda0%24%40liny.net. For more options, visit https://groups.google.com/d/optout.
