Skip to content

Commit

Permalink
Migrate startup to systemd service instead of using daemon in init.d …
Browse files Browse the repository at this point in the history
…script
  • Loading branch information
Mandalka committed May 21, 2019
1 parent 4b9011a commit f84e849
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 76 deletions.
2 changes: 1 addition & 1 deletion build/deb/stable/DEBIAN/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Version: 1.20
Section: misc
Priority: optional
Architecture: all
Depends: daemon(>=0),default-jre-headless(>=0)
Depends: default-jre-headless(>=0)
Installed-Size: 100
Maintainer: Markus Mandalka <debian@mandalka.name>
Homepage: https://opensemanticsearch.org/
Expand Down
9 changes: 6 additions & 3 deletions build/deb/stable/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

adduser --system --disabled-password tika

# load our additional service config
systemctl daemon-reload

# start while booting
update-rc.d tika defaults
systemctl enable tika

# start after installation
service tika restart
# (re)start after installation
systemctl restart tika
4 changes: 3 additions & 1 deletion build/deb/stable/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

service tika stop
systemctl disable tika

systemctl stop tika

exit 0
71 changes: 0 additions & 71 deletions etc/init.d/tika

This file was deleted.

12 changes: 12 additions & 0 deletions etc/systemd/system/tika.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Apache Tika Server
After=network.target

[Service]
Type=simple
User=tika
ExecStart=/usr/bin/java -jar /usr/share/java/tika-server.jar
Restart=always

[Install]
WantedBy=multi-user.target

0 comments on commit f84e849

Please sign in to comment.