sys-cluster/nomad/files/nomad.initd
changeset 237 2dec9f3e7ad5
parent 229 6dd295839db8
equal deleted inserted replaced
236:dd1dccdd8a6c 237:2dec9f3e7ad5
     1 #!/sbin/openrc-run
     1 #!/sbin/openrc-run
     2 # Copyright 2015-2017 Gentoo Foundation
     2 # Copyright 2020 Gentoo Authors
     3 # Distributed under the terms of the GNU General Public License v2
     3 # Distributed under the terms of the GNU General Public License v2
     4 
     4 
     5 description="nomad agent"
       
     6 extra_started_commands="reload"
       
     7 export GOMAXPROCS=${GOMAXPROCS:-2}
     5 export GOMAXPROCS=${GOMAXPROCS:-2}
     8 group=${group:-${RC_SVCNAME}}
     6 group=${group:-${RC_SVCNAME}}
     9 user=${user:-${RC_SVCNAME}}
     7 user=${user:-${RC_SVCNAME}}
       
     8 description="simple and flexible workload orchestrator"
       
     9 command="/usr/bin/${RC_SVCNAME}"
    10 pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
    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"
    11 command_background="true"
    14 start_stop_daemon_args="--user ${user} --group ${group} \
    12 start_stop_daemon_args="--user ${user} --group ${group} \
    15 	--stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
    13        --stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
    16 	--stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
    14        --stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
    17 stopsig="SIGINT"
    15 stopsig=SIGINT
       
    16 extra_started_commands=reload
    18 
    17 
    19 depend() {
    18 depend() {
    20 	need net
    19 	after net
    21 }
    20 }
    22 
    21 
    23 reload() {
    22 reload() {
    24 	ebegin "Reloading ${RC_SVCNAME}"
    23 	start-stop-daemon --signal HUP --pidfile "${pidfile}"
    25 	${command} reload
       
    26 	eend $?
       
    27 }
    24 }