-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from ljdelight/systemd
Systemd
- Loading branch information
Showing
5 changed files
with
93 additions
and
3 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
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,16 @@ | ||
[Unit] | ||
Description=Rawdisk service for remote block access | ||
After=syslog.target network.target | ||
|
||
[Service] | ||
Type=simple | ||
Environment=PORT=9093 | ||
Environment=CLASSPATH=/opt/ljdelight/rawdisk/RawDiskService-all.jar | ||
|
||
ExecStart=/usr/bin/java -classpath ${CLASSPATH} com.ljdelight.rawdisk.RawDiskServer ${PORT} | ||
Restart=on-failure | ||
RestartSec=3s | ||
SuccessExitStatus=0 SIGHUP SIGINT SIGTERM SIGPIPE | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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,37 @@ | ||
#!/bin/sh | ||
# See https://www.debian.org/doc/debian-policy/ | ||
# | ||
|
||
set -e | ||
|
||
case "$1" in | ||
configure) | ||
if [ $(command -v systemctl) > /dev/null ]; then | ||
cp -fp /opt/ljdelight/rawdisk/ljdelight-rawdisk.service /etc/systemd/system/ | ||
systemctl --quiet enable ljdelight-rawdisk.service > /dev/null | ||
systemctl --quiet start ljdelight-rawdisk.service > /dev/null | ||
elif [ $(command -v update-rc.d) > /dev/null ]; then | ||
ln -s /opt/ljdelight/rawdisk/ljdelight-rawdisk.init /etc/init.d/ljdelight-rawdisk | ||
update-rc.d ljdelight-rawdisk defaults > /dev/null | ||
service ljdelight-rawdisk start > /dev/null | ||
else | ||
echo "postinst could not register ljdelight-rawdisk: no systemctl nor update-rc.d" >&2 | ||
exit 1 | ||
fi | ||
;; | ||
|
||
abort-upgrade|abort-remove|abort-deconfigure) | ||
;; | ||
|
||
*) | ||
echo "postinst called with unknown argument \`$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# dh_installdeb will replace this with shell code automatically | ||
# generated by other debhelper scripts. | ||
|
||
#DEBHELPER# | ||
|
||
exit 0 |
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,34 @@ | ||
#!/bin/sh | ||
# See https://www.debian.org/doc/debian-policy/ | ||
|
||
set -e | ||
|
||
case "$1" in | ||
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) | ||
if [ $(command -v systemctl) > /dev/null ]; then | ||
systemctl --quiet stop ljdelight-rawdisk.service > /dev/null | ||
systemctl --quiet disable ljdelight-rawdisk.service > /dev/null | ||
rm -f /etc/systemd/system/ljdelight-rawdisk.service | ||
systemctl daemon-reload | ||
elif [ $(command -v update-rc.d) > /dev/null ]; then | ||
service ljdelight-rawdisk stop > /dev/null | ||
update-rc.d ljdelight-rawdisk remove > /dev/null | ||
rm -f /etc/init.d/ljdelight-rawdisk | ||
else | ||
echo "postrm could not determine systemctl or update-rc.d" >&2 | ||
exit 1 | ||
fi | ||
;; | ||
|
||
*) | ||
echo "postrm called with unknown argument \`$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# dh_installdeb will replace this with shell code automatically | ||
# generated by other debhelper scripts. | ||
|
||
#DEBHELPER# | ||
|
||
exit 0 |