mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-08-23 20:18:14 +02:00
scripts: move template files to "templates" directory
This commit is contained in:
parent
00d96cf045
commit
c5a8f20c04
7 changed files with 5 additions and 5 deletions
7
scripts/templates/config
Normal file
7
scripts/templates/config
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Default settings for {{ PACKAGE_NAME }}
|
||||
#
|
||||
# This is sourced by the systemd unit file.
|
||||
|
||||
# Command line flags to pass to {{ PACKAGE_NAME }}
|
||||
# First is IP to listen to, second is port.
|
||||
#OPTS="127.0.0.1 1337"
|
||||
9
scripts/templates/logrotate.conf
Normal file
9
scripts/templates/logrotate.conf
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{{ LOG_FILE }} {
|
||||
daily
|
||||
dateext
|
||||
dateformat _%Y-%m-%d
|
||||
rotate 10
|
||||
compress
|
||||
notifempty
|
||||
copytruncate
|
||||
}
|
||||
47
scripts/templates/rc.conf
Normal file
47
scripts/templates/rc.conf
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Add the following lines to /etc/rc.conf to configure eosio_api_healthcheck:
|
||||
#
|
||||
# eosio_api_healthcheck_args : arguments to the command.
|
||||
#
|
||||
# eosio_api_healthcheck_logfile : file to log to (default /var/log/${name}.log)
|
||||
#
|
||||
|
||||
# PROVIDE: {{ RC_NAME }}
|
||||
# REQUIRE: netif FILESYSTEMS
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="{{ RC_NAME }}"
|
||||
desc="{{ DESCRIPTION }}"
|
||||
command="{{ PROGRAM }}"
|
||||
command_args="${eosio_api_healthcheck_args}"
|
||||
logfile="${eosio_api_healthcheck_logfile:-/var/log/${name}.log}"
|
||||
pidfile="/var/run/${name}.pid"
|
||||
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd="${name}_stop"
|
||||
|
||||
eosio_api_healthcheck_start()
|
||||
{
|
||||
echo "Starting ${name}"
|
||||
${command} ${command_args} >${logfile} 2>&1 &
|
||||
echo $! > ${pidfile}
|
||||
}
|
||||
|
||||
eosio_api_healthcheck_stop()
|
||||
{
|
||||
rc_pid=$(check_pidfile ${pidfile} ${command})
|
||||
if $rc_pid; then
|
||||
rc_pid=$(cat ${pidfile})
|
||||
kill -$sig_stop $rc_pid
|
||||
wait_for_pids $rc_pid
|
||||
else
|
||||
_run_rc_notrunning
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
||||
5
scripts/templates/rsyslog.conf
Normal file
5
scripts/templates/rsyslog.conf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
if $programname == '{{ PROGRAM }}' then {
|
||||
{{ LOG_FILE }}
|
||||
stop
|
||||
}
|
||||
12
scripts/templates/sysunit.service
Normal file
12
scripts/templates/sysunit.service
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description={{ DESCRIPTION }}
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/{{ PACKAGE_NAME }}/env
|
||||
Type=simple
|
||||
ExecStart={{ PROGRAM }} $OPTS
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue