Skip to content

Commit

Permalink
Merge pull request #18 from ddndrk/version-1.0+systemd
Browse files Browse the repository at this point in the history
Version 1.0+systemd
  • Loading branch information
EinsamHauer authored Nov 25, 2020
2 parents 6ef53a2 + 15b1a7d commit 6d4bc42
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 201 deletions.
7 changes: 0 additions & 7 deletions pkg/deb/control/postinst
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
#!/bin/sh -e
# Fakeroot and lein don't get along, so we set ownership after the fact.
chown -R root:root /usr/lib/disthene-reader
chown root:root /usr/bin/disthene-reader
chown disthene-reader:disthene-reader /var/log/disthene-reader
chown -R disthene-reader:disthene-reader /etc/disthene-reader
chown root:root /etc/init.d/disthene-reader

if [ -x "/etc/init.d/disthene-reader" ]; then
update-rc.d disthene-reader start 50 2 3 4 5 . stop 50 0 1 6 . >/dev/null
invoke-rc.d disthene-reader start || exit $?
fi
3 changes: 0 additions & 3 deletions pkg/deb/control/postrm
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh -e
if [ "$1" = "purge" ] ; then
update-rc.d disthene-reader remove >/dev/null
fi
4 changes: 1 addition & 3 deletions pkg/deb/control/prerm
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/bin/sh -e
if [ -x "/etc/init.d/disthene-reader" ]; then
invoke-rc.d disthene-reader stop || exit $?
fi
systemctl stop disthene-reader || exit $?
18 changes: 0 additions & 18 deletions pkg/deb/disthene-reader

This file was deleted.

18 changes: 18 additions & 0 deletions pkg/deb/disthene-reader.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=Disthene reader server
StartLimitIntervalSec=180
StartLimitBurst=3

[Service]
Type=simple
User=disthene-reader
LimitNOFILE=1000000
LimitMEMLOCK=infinity
EnvironmentFile=/etc/default/disthene-reader
ExecStart=/usr/bin/java $JAVA_OPTS -jar /usr/lib/disthene-reader/disthene-reader.jar $OPTS
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target
149 changes: 0 additions & 149 deletions pkg/deb/init.sh

This file was deleted.

20 changes: 5 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>net.iponweb.disthene.reader</groupId>
<artifactId>disthene-reader</artifactId>
<packaging>jar</packaging>
<version>1.0.12</version>
<version>1.0.12+systemd</version>
<name>disthene-reader</name>
<url>http://maven.apache.org</url>
<dependencies>
Expand Down Expand Up @@ -187,23 +187,13 @@
</data>

<data>
<src>${basedir}/pkg/deb/init.sh</src>
<dst>disthene-reader</dst>
<src>${basedir}/pkg/deb/disthene-reader.service</src>
<dst>disthene-reader.service</dst>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/etc/init.d</prefix>
<filemode>755</filemode>
</mapper>
</data>

<data>
<src>${basedir}/pkg/deb/disthene-reader</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/usr/bin</prefix>
<filemode>755</filemode>
<prefix>/lib/systemd/system/</prefix>
<filemode>644</filemode>
</mapper>
</data>

Expand Down
2 changes: 1 addition & 1 deletion puppet/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
service { 'disthene-reader':
ensure => running,
hasrestart => true,
restart => '/etc/init.d/disthene-reader reload',
restart => '/bin/systemctl reload disthene-reader.service',
require => [Package['disthene-reader'],
File['disthene_reader_config'],
],
Expand Down
14 changes: 9 additions & 5 deletions puppet/templates/disthene-reader-default.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# JAVA_OPTS
JAVA_OPTS="-server"
JAVA_OPTS="-Xms<%= @java_xms %> -Xmx<%= @java_xmx %>"
JAVA_OPTS="$JAVA_OPTS <%= @java_extra_options %>"
JAVA_OPTS="-Xms<%= @java_xms %> -Xmx<%= @java_xmx %> <%= @java_extra_options %>"

# DISTHENE_OPTS
OPTS=""

# Alternative path to config file
# default is /etc/disthene-reader/disthene-reader.yaml
# DISTHENE_CONFIG_FILE=
# OPTS="-c /etc/disthene-reader/disthene-reader.yaml"

# Alternative path to log4j config file
# default is /etc/disthene-reader/disthene-reader-log4j.xml
# DISTHENE_LOG_CONFIG_FILE=
# OPTS="-l /etc/disthene-reader/disthene-reader-log4j.xml"
#
# Alternative path to config and log4j config files together
# OPTS="-c /etc/disthene-reader/disthene-reader.yaml -l /etc/disthene-reader/disthene-reader-log4j.xml"

0 comments on commit 6d4bc42

Please sign in to comment.