website

My personal website
git clone git://git.ckyln.com/website
Log | Files | Refs

index.txt (2958B)


      1 SYSMGR
      2 ================================================================================
      3 
      4 sysmgr is a service manager that aims to do as little as possible for service
      5 supervision. It can be viewed as a simplified version of [runit]. It only cares
      6 about making sure certain processes are alive unless explicitly stopped. Unlike
      7 runit, it doesn't care about logging, or stopping daemons with special commands,
      8 as those can easily be handled by service scripts themselves. It doesn't have
      9 supervise directories with FIFOs inside. It _ONLY_ cares about processes and
     10 nothing else.
     11 
     12 [runit]: http://smarden.org/runit
     13 
     14 
     15 Interacting with sysmgr
     16 --------------------------------------------------------------------------------
     17 
     18 While sysmgr can be interacted entirely with POSIX base tools, sysmgr provides
     19 a tool named 'svctl' for interacting with sysmgr. This tool can be used to check
     20 the status and start/stop/restart services.
     21 
     22 When sysmgr picks up a service script inside the service directory, it
     23 automatically starts the service unless stopped.
     24 
     25 
     26 Details of implementation
     27 --------------------------------------------------------------------------------
     28 
     29 The initial implementation of sysmgr was written in POSIX shell, and it used
     30 POSIX compliant base-tools, however, in order to spawn as little processes as
     31 possible, it did some Linuxisms which prevented portability. The current
     32 implementation is written in C99, and it only uses functions from the POSIX-2008
     33 C Library, so it should work on all POSIX-compatible systems. Testing required.
     34 
     35 
     36 Building and installing
     37 --------------------------------------------------------------------------------
     38 
     39 Before building sysmgr, it is best to take a look at the config.h and config.mk
     40 files, and modify them to fit your system. Afterwards you can do the following
     41 (as root if necessary):
     42 
     43     make
     44     make install
     45 
     46 
     47 You can then install service scripts to your service directory and run sysmgr.
     48 
     49 
     50 Service scripts
     51 --------------------------------------------------------------------------------
     52 
     53 Service scripts can be any executable ranging from shell scripts to C binaries.
     54 The only requirement is that they can be executable. An example script is as
     55 follows:
     56 
     57     #!/bin/sh -e
     58     exec httpd -f -p 8080 -h /var/pub/www
     59 
     60 
     61 The exec call in the shell script makes sure that sysmgr is tracking the process
     62 id of the httpd program rather than the shell script. It isn't necessary, but it
     63 is the best practice to do so.
     64 
     65 On certain occasions a service can depend on other services to be able to start.
     66 That's why a sysmgr-depends tool is supplied, in order to make sure a service
     67 can wait until another service is up.
     68 
     69     #!/bin/sh -e
     70     sysmgr-depends dbus
     71     exec NetworkManager -n
     72 
     73 
     74 More information
     75 --------------------------------------------------------------------------------
     76 
     77 More usage information can be found on the following manual pages:
     78 
     79 - runsyssv(1)
     80 - svctl(1)
     81 - sysmgr(8)
     82 - sysmgr-depends(1)
     83