On Fri, 21 Jan 2005 20:40, Andrew Errington wrote: > On Fri, 21 Jan 2005 19:24, you wrote: > > On Fri, 21 Jan 2005 11:17, Andrew Errington wrote: > > > Hello, > > > > > > I have a "style" question regarding a process that I wish to run all > > > the time. > > > > You don't mention which distribution you are running, we can only reply > > in general terms. > > General is fine, but I'm running Debian 3.0 (Woody) > > > The quick and dirty way is to make an entry into the file provided for > > the purpose. There will be a file in the /etc/rc.d directory tree ( > > RedHat et al ) into which you can put commands to run at the end of the > > start-up sequence. The file is called /etc/rc.d/rc.local on mandrake ( > > 8.? ) and Other dists. will use something similar. > > > > imho ( as a purist ) you should run these daemons using their own user. > > The data can then be stored in their home directory also. > > Well this is exactly the kind of answer I'm looking for, which is really > why it is a "style" question. > > In this case, how to start the daemon? At start-up, the 'leet' way is to make an entry in the /etc/init.d/ directory for the daemons, and the symbolic links to start and stop in the appropriate runlevel directories. There is iirc ( long time since I had Debian running ) a 'skel' file in there. copy it to the 'weather' file and edit & adjust appropriately.
> A cron job for the user "weather" instead of for me? You could set up a cron job for the weather user to check that the daemons are still running ok and restart them if needed. ( And tell you ) > If I put them in rc.local or inittab they will run as > root (is that right?). rc.local can be as any user, e.g. su -c weather weather.daemon , but inittab is only as root. An inittab entry should imho be used to start the hardware driver daemon such as a serial line driver ( i.e. the [amp]getty processes ), but not higher level daemons. btw I whole heartedly recommend Gert Doering's mgetty. > > You might like to save the pids in the directory /var/run > > It's then easy to check that they are still running unambiguously, and to > > kill them off simply. > > Neat. np, e.g. kill `cat /var/pid/weather.pid` -- Sincerely etc., Christopher Sawtell
