Forums

Create a daemon or a task launched after reboot?

Hello,

I would like to create a daemon or a task that is launched only one time, when my app/server is started / reloaded. With the scheduler, I can only create a hourly or daily task

Thank you

In our infrastructure, the idea of "when your app/server is started", doesn't really make sense. You can use the scheduler to ensure that a process is running by using a lock and relying on the scheduler to start it again if it's not running. Of course, this will mean that there could be times of up to an hour (if you only use one scheduled task) where the process will not be running. You can use additional scheduled tasks to reduce the amount time where the task is not running.

Not sure I understood exactly how I can use a lock; but I will search. If I open a shell console to launch a task. Can this task run indefinitely, or is there a timeout before automatically kill any open console?

We don't have an automatic timeout, but consoles can be killed (for instance when we upgrade. This is something we'd like to change but ,for the moment, we're stuck with it). If a console does get killed, the process you were running in it will not get restarted.