ninit-scan(8)

NAME
ninit-scan - scan directory and start/stop services

SYNOPSIS
ninit-scan [ -[uod] ] services_directory ninit_home

DESCRIPTION
ninit-scan scans a directory to start/stop a collection of services.

Service definitions are installed, configured and activated as subdi- rectories of the services_directory. As ninit-scan sequentially scans the services_directory, it looks for subdirectory names not beginning with `.'. If ninit-scan then finds the `sticky' bit set on the subdirectory, it considers the service definition ``active'' and attempts to start/stop the corrsponding service.

OPTIONS
If no option is given ninit-scan try to start the service in respawn ON or OFF mode depending on the existence of the file respawn in the service subdirectory.

-u  Up. If the service is not running, start it. If the service stops, restart it.

-o  Once. If the service is down, start it. If the service stops, do not restart it.

-d  Down. If the service is running, send it a TERM signal and then a CONT signal. After it stops, do not restart it.

EXAMPLES
ninit-scan -u net /etc/ninit
start all services /etc/ninit/net/* which have `sticky' bit set in respawn mode. ninit-scan etc /etc/ninit
start all services /etc/ninit/etc/* which have `sticky' bit set. ninit-scan -d '' /etc/ninit
stop all services /etc/ninit/* which have `sticky' bit set.

USAGE
This is similar to the file depends. Put in rsetup the following: #!/bin/sh
exec $2/bin/ninit-scan $1 $2 The program is shell script. See the code to understand how it works. ninit-scan is designed to permit easy service activation/deactivation using the chmod(1) utility. You can set/unset `sticky' bit with chmod +t myservice
chmod -t myservice

AUTHOR
Nikola Vladov. Thanks to Wayne Marshall for the `sticky' bit idea.
http://b0llix.net/perp/

SEE ALSO
ninit(8), nsvc(8), perpd(8), chmod(1)