On Mon, Dec 17, 2001 at 07:33:13AM +0100, Striegel, Juergen wrote:
> I've got another question about that:
> what if I want to start an application automatically that don't run as root?
> I suggest running an app from inittab or via rc.local the app runs as
> root...
> BTW: I hope accessing a device (over the net) that is 'autostarted'
> in this way still require a login??
> Juergen
su -c '/where/ever/what.ever and its arguments ' username
... you can put a line like that in inittab --- though,
you might have to fuss with it a bit; for instance if you
background the command, or it daemonizes itself, then your inittab
respawn directive could end up "respawning too fast" (and be
disabled for 5 minutes at a time, then going through a flurry of
quick respawn, ad nauseum).
If that's the case, you might just want to run a monitor program
which checks for your process and attempts to respawn it anytime
it dies or fails to respond to some internal test/request.
A *very* good way to monitor your processes is to get the
"watchdog" package from the Debian distribution (get the sources
if you like).
Watchdog, or something like it, should be in just about every
embedded Linux system you deploy. It performs a number of
standard checks on the system:
given process (specified by a pid file) still running?
full process table?
free memory?
given files are accessible?
given files change in a given interval?
load exceeds threshold?
file table overflow?
given IP address(es) answers pings?
given network interfaces received some traffic?
temperature? (if available via lmsensors or ???).
+ optional custom binary for further tests
... not that the first one is the one to which I've already
alluded. If you can get the app to write a PID file, then
you can have the watchdog timer process periodically
perform a "kill(0)" process status check on it.
The default is to sleep for 10 seconds, and for the kernel
watchdog timer driver to give upto a full minute. So the
watchdog daemon will have six chances to "pat the dog on the
head" ("Nice Doggie! Don't strobe the reset line!") before
the kernel will do a reboot.
The watchdog tool can also schedule itself as a real-time
process (so that it's guaranteed never to swap out). That
will lock its pages of overhead into core/RAM making (so the
watchdog won't get swapped out, and cause a spurious reboot)
Of course, if the watchdog daemon is too big or otherwise
doesn't suit your needs, you could still look at the code
and create your own derivative "lightweight" version. (It's
under the GPL, so you'd want to release your derivative
sources as appropriate).
>> -----Urspr�ngliche Nachricht-----
>> Von: Israel Alvarez [mailto:[EMAIL PROTECTED]]
>> Gesendet am: Freitag, 14. Dezember 2001 18:21
>> An: [EMAIL PROTECTED]
>> Betreff: Is Login really neccesary?
>> needed to find the way of loggin into the system without user
>> and password request because the final product will not have
>> any input device. The
--
Jim Dennis
--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.