openrc.init (889 bytes)
1 #!/sbin/openrc-run 2 3 command="" # absolute path 4 command_args="" # pid file, run as daemon 5 6 # command_background="yes" # if you can't run as daemon natively 7 # pidfile="/run/$RC_SVCNAME.pid" # if you can get one from the command/want to be able to stop it with pid signals 8 9 depend() { 10 # Depends on hitch or another reverse proxy with TLS 11 # Depends on a cache/gzipping program such as varnish 12 # add as required 13 #need X X X 14 #want X X X 15 #use X X X 16 #provide X 17 # will start immediately before/after something else (prevents parallelisation) 18 #before X 19 #after x 20 } 21 22 start() { 23 ebegin "Starting i2pd" 24 start-stop-daemon \ 25 --start \ 26 # set the name 27 --name NAME # --ionice 2:7 --nicelevel 12 # example nice levels. 28 --exec "$command" \ 29 -- $command_args 30 eend $? 31 } 32 33 34 stop() { 35 start-stop-daemon --stop --quiet --pidfile "/run/$RC_SVCNAME.pid" 36 }