-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a systemd standard opentsdb service script to launch using the port
defined in the config file. Fixes #2033
- Loading branch information
Showing
4 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Copyright (C) 2011-2012 The OpenTSDB Authors. | ||
# Copyright (C) 2011-2021 The OpenTSDB Authors. | ||
# | ||
# This library is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU Lesser General Public License as published | ||
|
@@ -30,6 +30,7 @@ dist_noinst_SCRIPTS = src/create_table.sh src/upgrade_1to2.sh src/mygnuplot.sh \ | |
src/mygnuplot.bat src/opentsdb.conf tools/opentsdb_restart.py src/logback.xml | ||
dist_noinst_DATA = pom.xml.in build-aux/rpm/opentsdb.conf \ | ||
build-aux/rpm/logback.xml build-aux/rpm/init.d/opentsdb \ | ||
build-aux/rpm/systemd/opentsdb.service \ | ||
build-aux/rpm/systemd/[email protected] | ||
tsdb_SRC := \ | ||
src/core/AbstractSpanGroup.java \ | ||
|
@@ -734,6 +735,7 @@ install-data-etc: | |
init_file="$(top_srcdir)/build-aux/rpm/init.d/opentsdb" ; \ | ||
echo " $(INSTALL_SCRIPT)" $$init_file "$$destdatainitdir" ; \ | ||
$(INSTALL_SCRIPT) $$init_file "$$destdatainitdir" || exit 1; \ | ||
systemd_file="$(top_srcdir)/build-aux/rpm/systemd/opentsdb.service" ; \ | ||
systemd_file="$(top_srcdir)/build-aux/rpm/systemd/[email protected]" ; \ | ||
echo " $(INSTALL_SCRIPT)" $$systemd_file "$$destdatasystemddir" ; \ | ||
$(INSTALL_SCRIPT) $$systemd_file "$$destdatasystemddir" || exit 1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=OpenTSDB | ||
After=network-online.target | ||
Before=shutdown.target | ||
|
||
[Service] | ||
Type=simple | ||
User=opentsdb | ||
Group=opentsdb | ||
LimitNOFILE=65535 | ||
Environment='JVMARGS=-DLOG_FILE=/var/log/opentsdb/opentsdb.log -DQUERY_LOG=/var/log/opentsdb/queries.log -XX:+ExitOnOutOfMemoryError -enableassertions -enablesystemassertions' | ||
ExecStart=/usr/bin/tsdb tsd --config /usr/share/opentsdb/etc/opentsdb/opentsdb.conf | ||
Restart=always | ||
StandardOutput=journal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ rm -rf %{buildroot} | |
make install DESTDIR=%{buildroot} | ||
mkdir -p %{buildroot}%{_localstatedir}/cache/opentsdb | ||
mkdir -p %{buildroot}%{_localstatedir}/log/opentsdb | ||
mkdir -p %{buildroot}%{_localstatedir}/tmp/opentsdb | ||
mkdir -p %{buildroot}%{_datarootdir}/opentsdb/plugins | ||
# TODO: Use alternatives to manage the init script and configuration. | ||
|
||
|
@@ -77,8 +78,10 @@ rm -rf %{buildroot} | |
%doc | ||
%{_datarootdir}/opentsdb | ||
%{_bindir}/tsdb | ||
%dir %attr(0755,opentsdb,opentsdb) %{_tmppath}/opentsdb | ||
%dir %attr(0755,opentsdb,opentsdb) %{_localstatedir}/cache/opentsdb | ||
%dir %attr(0755,opentsdb,opentsdb) %{_localstatedir}/log/opentsdb | ||
%dir %attr(0755,opentsdb,opentsdb) %{_localstatedir}/tmp/opentsdb | ||
|
||
%changelog | ||
|
||
|
@@ -91,6 +94,7 @@ if [ $1 -eq 1 ]; then | |
# we're installing the first version of this package | ||
ln -s %{_datarootdir}/opentsdb/etc/opentsdb /etc/opentsdb | ||
if [ -d /run/systemd/system ]; then | ||
ln -s %{_datarootdir}/opentsdb/etc/systemd/system/opentsdb.service /lib/systemd/system | ||
ln -s %{_datarootdir}/opentsdb/etc/systemd/system/[email protected] /lib/systemd/system | ||
systemctl daemon-reload | ||
else | ||
|
@@ -104,6 +108,7 @@ if [ $1 -eq 0 ]; then | |
# we're removing last version of this package | ||
[ -L /etc/opentsdb ] && rm -f /etc/opentsdb | ||
[ -L /etc/init.d/opentsdb ] && rm -f /etc/init.d/opentsdb | ||
[ -L /lib/systemd/system/opentsdb.service ] && rm -f /lib/systemd/system/opentsdb.service | ||
[ -L /lib/systemd/system/[email protected] ] && rm -f /lib/systemd/system/[email protected] | ||
[ -d /run/systemd/system ] && systemctl daemon-reload | ||
fi | ||
|