Skip to content

Commit

Permalink
Add systemd unit and timer for synchroneous and asynchronous tasks (#50
Browse files Browse the repository at this point in the history
…) (#260)

Co-authored-by: Xavier Bachelot <[email protected]>
  • Loading branch information
davidcoutadeur and xavierba authored Jan 19, 2024
1 parent 617b370 commit 6b0b6b9
Show file tree
Hide file tree
Showing 14 changed files with 196 additions and 429 deletions.
2 changes: 1 addition & 1 deletion src/install/debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8
11
6 changes: 3 additions & 3 deletions src/install/debian/lsc.install
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ etc/logback.xml etc/lsc
lib/* usr/lib/lsc
## sample
sample/* usr/share/doc/lsc
## init
etc/init.d/lsc etc/init.d
etc/default/lsc etc/default
## systemd
etc/default/lsc-sync etc/default
etc/default/lsc-async etc/default
## nagios
bin/check_lsc* var/lib/lsc/nagios

6 changes: 0 additions & 6 deletions src/install/debian/lsc.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ sed -i 's:^CFG_DIR.*:CFG_DIR="/etc/lsc":' /usr/bin/lsc /usr/bin/lsc-agent /usr/b
sed -i 's:^LIB_DIR.*:LIB_DIR="/usr/lib/lsc":' /usr/bin/lsc /usr/bin/lsc-agent /usr/bin/hsqldb
sed -i "s:^LOG_DIR.*:LOG_DIR=\"${lsc_logdir}\":" /usr/bin/lsc /usr/bin/lsc-agent /usr/bin/hsqldb
sed -i 's:^VAR_DIR.*:VAR_DIR="/var/lsc":' /usr/bin/hsqldb
## init
sed -i 's:^LSC_BIN.*:LSC_BIN="/usr/bin/lsc":' /etc/default/lsc
sed -i 's:^LSC_CFG_DIR.*:LSC_CFG_DIR="/etc/lsc":' /etc/default/lsc
sed -i 's:^LSC_USER.*:LSC_USER="lsc":' /etc/default/lsc
sed -i 's:^LSC_GROUP.*:LSC_GROUP="lsc":' /etc/default/lsc
sed -i 's:^LSC_PID_FILE.*:LSC_PID_FILE="/var/run/lsc.pid":' /etc/default/lsc

# Copy sample configuration for a fresh install
[ -f /etc/lsc/lsc.xml ] || cp /usr/share/doc/lsc/lsc.xml-sample /etc/lsc/lsc.xml
Expand Down
18 changes: 18 additions & 0 deletions src/install/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,21 @@
dh $@

override_dh_compress:

override_dh_testdir:
## systemd
cp -f lib/systemd/system/lsc-async.service debian/
cp -f lib/systemd/system/[email protected] debian/
cp -f lib/systemd/system/lsc-sync.service debian/
cp -f lib/systemd/system/lsc-sync.timer debian/
cp -f lib/systemd/system/[email protected] debian/
cp -f etc/default/lsc-async debian/lsc-async.default
cp -f etc/default/lsc-sync debian/lsc-sync.default
dh_testdir

override_dh_installsystemd:
dh_installsystemd --no-start --no-enable --no-stop-on-upgrade --name=lsc-async
dh_installsystemd --no-start --no-enable --no-stop-on-upgrade --name=lsc-async@
dh_installsystemd --no-start --no-enable --no-stop-on-upgrade --name=lsc-sync
dh_installsystemd --no-start --no-enable --no-stop-on-upgrade --name=lsc-sync@
dh_installsystemd --name=lsc-sync.timer
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
# (http://www.lsc-project.org).
#====================================================================

# LSC installation
LSC_BIN="/usr/local/lsc/bin/lsc"
LSC_CFG_DIR="/usr/local/lsc/etc"
LSC_USER=""
LSC_GROUP=""
LSC_PID_FILE="/var/run/lsc.pid"
LSC_TASKS="all"
LSC_PARAMS=""

# JMX
LSC_JMXPORT="1099"

# JAVA
#JAVA_HOME=/usr/java/jdk/jre

LSC_CONFIG_DIR="/etc/lsc"
#LSC_SYNC_TASKS=""
LSC_ASYNC_TASKS="-a all"
#LSC_CLEAN_TASKS=""
LSC_EXTRA_ARGS=""
16 changes: 16 additions & 0 deletions src/install/etc/default/lsc-sync
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#====================================================================
# Configuration for LSC init script
# (http://www.lsc-project.org).
#====================================================================

# JMX
LSC_JMXPORT="1099"

# JAVA
#JAVA_HOME=/usr/java/jdk/jre

LSC_CONFIG_DIR="/etc/lsc"
LSC_SYNC_TASKS="-s all"
#LSC_ASYNC_TASKS=""
LSC_CLEAN_TASKS="-c all"
LSC_EXTRA_ARGS=""
Loading

0 comments on commit 6b0b6b9

Please sign in to comment.