Should a daemon on an embedded device using Busybox be written in C or as a script?
All the examples I have seen use #! /bin/ash at the top of the file and that is for scripting? But in the device I'm writing to has only complied C files (I thnk) and symbolic links in /usr/bin.
Everyway I try to compile a C file with #include (e.g. gcc -Wall -o daemon_busybox daemon_busybox.c ) I get error after error report in /bin/ash
/bin/ash:174:1: error: stray ‘\213’ in program /bin/ash:174:1: error: stray ‘\10’ in program /bin/ash:174:1: error: stray ‘\273’ in program /bin/ash:174:1: error: stray ‘\204’ in program /bin/ash:174:1: error: stray ‘\342’ in program
Note I have set this: /bin/ash -> busybox
Any ideas which why I should go?
Update:
I've been given the task trying to see if a daemon can be run on a small device that runs linux (2.6.35-at-alpha4) and java (SE Embedded Runtime Environment) with very limited memory (i.e. a 10 second wait to get java -version to report back).
Two weeks ago I didn't know much about daemons - only knew the word. So, this is all new to me.
On my development machine I have built two different daemon files one in C and one as a script. Both run very nicely on my linux machine.
But because of the very small size of the target device there is only busybox. (no /lib/lsb/init-functions) So I'm trying to build a 3rd daemon file. I believe it should be written in C for this device, but all examples for busybox point to scripting.
Aucun commentaire:
Enregistrer un commentaire