mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-06-18 05:00:03 +02:00
deb package: adding environment file for systemctl
This commit is contained in:
parent
90b559a518
commit
c926b4b5e5
3 changed files with 16 additions and 1 deletions
|
|
@ -30,10 +30,17 @@ cat ${BASE_DIR}/${PACKAGE_TMPDIR}/DEBIAN/control
|
|||
# Create service file
|
||||
mkdir -p ${BASE_DIR}/${PACKAGE_TMPDIR}/etc/systemd/system
|
||||
cat ${BASE_DIR}/template.service \
|
||||
| sed "s~{{ PACKAGE_NAME }}~${PACKAGE_NAME}~" \
|
||||
| sed "s~{{ DESCRIPTION }}~${PACKAGE_DESCRIPTION}~" \
|
||||
| sed "s~{{ PROGRAM }}~/${PACKAGE_PREFIX}/bin/${PACKAGE_NAME}~" \
|
||||
> ${BASE_DIR}/${PACKAGE_TMPDIR}/etc/systemd/system/${PACKAGE_NAME}.service
|
||||
|
||||
# Cerate config file
|
||||
mkdir -p ${BASE_DIR}/${PACKAGE_TMPDIR}/etc/${PACKAGE_NAME}
|
||||
cat ${BASE_DIR}/config \
|
||||
| sed "s~{{ PACKAGE_NAME }}~${PACKAGE_NAME}~" \
|
||||
> ${BASE_DIR}/${PACKAGE_TMPDIR}/etc/${PACKAGE_NAME}/env
|
||||
|
||||
# Copy program
|
||||
mkdir -p ${BASE_DIR}/${PACKAGE_TMPDIR}/${PACKAGE_PREFIX}/bin
|
||||
cp ${BASE_DIR}/../${PACKAGE_PROGRAM} ${BASE_DIR}/${PACKAGE_TMPDIR}/${PACKAGE_PREFIX}/bin/${PACKAGE_NAME}
|
||||
|
|
|
|||
7
scripts/config
Normal file
7
scripts/config
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Default settings for {{ PACKAGE_NAME }}
|
||||
#
|
||||
# This is sourced by the systemd unit file.
|
||||
|
||||
# Command line flags to pass to {{ PACKAGE_NAME }}
|
||||
# First is IP to listen to, second is port.
|
||||
#OPTS="127.0.0.1 1337"
|
||||
|
|
@ -3,11 +3,12 @@ Description={{ DESCRIPTION }}
|
|||
After=network.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/{{ PACKAGE_NAME }}/env
|
||||
Type=simple
|
||||
# Another Type: forking
|
||||
#User=nanodano
|
||||
#WorkingDirectory=/home/nanodano
|
||||
ExecStart={{ PROGRAM }}
|
||||
ExecStart={{ PROGRAM }} $OPTS
|
||||
Restart=on-failure
|
||||
# Other restart options: always, on-abort, etc
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue