svc

Simple service scripts and examples, to be used everywhere.
git clone git://r-36.net/svc
Log | Files | Refs | README | LICENSE

README.md (1442B)


      1 # SVC – Service Handling
      2 
      3 This framework is a simple tool to handle service starting and restarting.
      4 
      5 The documentation is sparse due to it being in alpha stage.
      6 
      7 ## Installation
      8 
      9 	% chmod 755 /bin/svc
     10 	% cp -rf svc.d /bin/svc.d
     11 
     12 ## Services
     13 ### Simplest case
     14 
     15 	% touch /bin/svc.d/avail/somebin
     16 	% svc -s somebin
     17 
     18 This will run »somebin« in the $PATH using the script in /bin/svc.d/bare.sh.
     19 
     20 ### Some params
     21 
     22 	% touch /bin/svc.d/avail/somebin
     23 	% echo 'PARAMS="-a"' > /bin/svc.d/default/somebin
     24 	% svc -s somebin
     25 
     26 This will run »somebin -a« in the $PATH using the script /bin/svc.d/bare.sh.
     27 
     28 ### Own script
     29 
     30 	% cp /bin/svc.d/bare.sh /bin/svc.d/default/somebin
     31 	% $EDITOR /bin/svc.d/default/somebin
     32 	% echo 'SOME_VAR="no"' > /bin/svc.d/default/somebin
     33 	% svc -s somebin
     34 
     35 This will run »somebin« with the script at /bin/svc.d/default/somebin using the
     36 special variable from /bin/svc.d/default/somebin.
     37 
     38 ## svc(1)
     39 
     40 	% svc -a	# list all links in /bin/svc.d/run (all activated services)
     41 	% svc -a ser	# activate service »ser« to be run on startup
     42 	% svc -c	# create the basic directories of svc (configure)
     43 	% svc -d ser	# deactivate service »ser«
     44 	% svc -k	# kill all services linked to /bin/svc.d/run
     45 	% svc -k ser	# kill the service »ser«
     46 	% svc -s	# run all services linked to /bin/svc.d/run
     47 	% svc -s ser	# run service »ser«
     48 	% svc -l	# list all services in /bin/svc.d/avail
     49 	% svc -r ser	# restart service »ser«
     50 
     51 Have fun!
     52