Skip to content

Commit d5256c5

Browse files
committed
add service file
Signed-off-by: Zen <[email protected]>
1 parent c6aeab4 commit d5256c5

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

json_exporter.include

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/sbin/openrc-run
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
description="Prometheus JSON exporter"
5+
6+
command="json_exporter"
7+
config_file="/etc/json_exporter/config.toml"
8+
command_args="-a 0.0.0.0 ${config_file}" # change if you don't want it listening on all interfaces
9+
pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
10+
command_background="true" # It stays in the foreground
11+
log_dir="/var/log/${RC_SVCNAME}"
12+
start_stop_daemon_args="--stdout ${log_dir}/${RC_SVCNAME}.log --stderr ${log_dir}/${RC_SVCNAME}.log"
13+
14+
depend() {
15+
after net
16+
}
17+
18+
19+
start_pre() { # This dir should be created by the ebuild
20+
checkpath -q -d -m 0755 "$log_dir"
21+
}
22+
23+
reload() {
24+
einfo "Reloading ${RC_SVCNAME}"
25+
ebegin "Sending SIGHUP to ${RC_SVCNAME}"
26+
start-stop-daemon --signal HUP --pidfile "${pidfile}"
27+
eend $?
28+
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "json_exporter"
7-
version = "1.0.0"
7+
version = "1.0.1"
88
authors = [
99
{ name="Desultory", email="[email protected]" },
1010
]

0 commit comments

Comments
 (0)