Skip to content

snanmre/service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

service

Simpler version of upstart

Description

With this program, you can start other programs/scripts as a daemon, save logs and respawn if ended unexpectedly. In general, this runs as a simpler version of upstart.

Details

Related directories/files

Definitions in fileutils.h

  • DIRPATH_SERVICES("./services"): directory path of service configuration files
  • DIRPATH_SERVICE_SCRIPTS("/run/shm/service"): directory of service script files
  • DIRPATH_SERVICE_PIDS("/run/service"): directory of service pid files
  • FILEPATH_SERVICES_LIST("/run/service/services.list"): file that contains running services

Defining a service

Service configuration files must have ".conf" extension.
Sample files:

Sample configuration file

# execute command
exec sleep 5

# or, you can define a script
#script
#  echo "starting..."
#  sleep 5
#end script


# log file path(default /dev/null)
# log /run/sample1.log


# wipe log on start/restart
# wipe log


# pid file path (default: /run/service/<service_name>.pid)
# pidfile /run/sample1.pid


# respawn service if it dies
respawn


# set respawn options
#    limit: respawn limit count, default: int max
#    interval: delay before start in seconds: 0
#
#    respawn limit <limit> <interval
respawn limit 5 1

About

Simpler version of upstart

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published