How to make sure a ipk process always running?

using cron like ?

is it a good method?
another question: how to make crond start up after boot by change configure file?

cron is for scheduling jobs.

having them run constantly is achieved by adding & at the end of the command line,
or setting it up as a service.

crond will start on boot, since it's the scheduler, but you can start/restart it manually through the webUI.

1 Like

crond will start on boot if there is one task or more in the list. Cron is good for running commands that have an end, for example run a backup script on a schedule.

To keep a service running you should make a service, so an init script for it
possibly one using procd functionality because procd is able to track the service status and restart it if crashes

default cron is not enable

cron will enable if you add at least a task in the list

now im using the service like below

#!/bin/sh /etc/rc.common
# "new(er)" style init script
# Look at /lib/functions/ on a running system for explanations of what other SERVICE_
# options you can use, and when you might want them.
start() {
        service_start /usr/bin/$APP
stop() {
        service_stop /usr/bin/$APP

so system help me do restart the ipk app if it is crashed?

no, because that is a normal service. Normal service only starts and stops with system.

If you want restart if crashed you should make initscript that uses procd
and use the "respawn" option from "advanced options" paragraph


how does it work and does it monitor the pid?

it will monitor the process you write in
procd_set_param command /bin/myapp

because procd is running that command and the process will then become its child process.

So you must write there the actual application, so for example /bin/myapp above not a script that launches it and then quits

I do not know how this works, there is little documentation about how procd actually does this job. You can look at the source code.;a=tree

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.