I'm using AntiX Linux, which is not using systemd, and I want to create a daemon in which I can echo to do something. How do I do that properly?
This is how I want to use it:
...
echo "got signal 1 use lock" > mydaemon
...
I'm using AntiX Linux, which is not using systemd, and I want to create a daemon in which I can echo to do something. How do I do that properly?
This is how I want to use it:
...
echo "got signal 1 use lock" > mydaemon
...
The init system and how to configure your program to be run by it is just one part of the problem. You will have to write the program itself to become a daemon when run. This involves forking into the background, creating a new session and disassociating from the controlling terminal, among other things. These steps are not necessary with systemd, because systemd runs your program in a wrapper that performs all these steps for you, but other init systems typically don't. For more information, see Daemon Process