sys-cluster/nomad/files/nomad.initd
changeset 229 6dd295839db8
child 237 2dec9f3e7ad5
equal deleted inserted replaced
228:9380ea9128d5 229:6dd295839db8
       
     1 #!/sbin/openrc-run
       
     2 # Copyright 2015-2017 Gentoo Foundation
       
     3 # Distributed under the terms of the GNU General Public License v2
       
     4 
       
     5 description="nomad agent"
       
     6 extra_started_commands="reload"
       
     7 export GOMAXPROCS=${GOMAXPROCS:-2}
       
     8 group=${group:-${RC_SVCNAME}}
       
     9 user=${user:-${RC_SVCNAME}}
       
    10 pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
       
    11 command="/usr/bin/${RC_SVCNAME}"
       
    12 command_args="agent ${command_args:-config-dir=/etc/consul.d}"
       
    13 command_background="true"
       
    14 start_stop_daemon_args="--user ${user} --group ${group} \
       
    15 	--stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
       
    16 	--stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
       
    17 stopsig="SIGINT"
       
    18 
       
    19 depend() {
       
    20 	need net
       
    21 }
       
    22 
       
    23 reload() {
       
    24 	ebegin "Reloading ${RC_SVCNAME}"
       
    25 	${command} reload
       
    26 	eend $?
       
    27 }