I want to create a small script for my Linux system that would do some simple things on PC boot. The script is most likely going to be Python, but maybe I'll resort to C or shell.The problem is that I'm a Windows developer, and the tutorials on the web look suspicious.Some of them close all file descriptors, some don't, some implement restart, force-restart, some don't. With later ones seemingly being against the spec. Then there is the whole gid thing, that confuses me.So basically, I don't know which script base I can use for a stable daemon, and which ones are works-on-my-machine-so-it's-correct type.Then I stumbled upon http://manpages.ubuntu.com/manpages/hardy/man1/daemon.1.html which seems to be an official process that creates daemons, SAFELY. But then again, it's scripts in init.d that do the start-up, if I understand correctly, not existing processes.Then there is nice which should be used for long running tasks, if I got it right, and probably some other gotchas.So I'm lost here. Can anyone give me a few warnings, don'ts and maybe an idea where to look for the information online?P.S. The script I'm going to call will have to call processes, does that mean the daemon will fork for each of them?
What's the cleanest way to schedule autoexec.bat like command in Linux?
linux;startup;daemon
Well, it seems that the new way to do things in most recent distros is to use Upstart - http://upstart.ubuntu.com/cookbook/This should allow paralleled task execution as well as clean syntax. SystemV init procedures through init.d and rc.d are supposedly there only for backwards compatibility.Reading through the manual seems that Upstart is very powerful and clean solution, but I still have a lot to study.