diff --git a/scripts/install_linux.sh b/scripts/install_linux.sh index c190202..a5d882e 100755 --- a/scripts/install_linux.sh +++ b/scripts/install_linux.sh @@ -16,12 +16,12 @@ cat ${TEMPLATE_DIR}/sysunit.service \ | sed "s~{{ PROGRAM }}~${BINDIR}/${PROGRAM_NAME}~" \ > ${SYSUNITDIR}/${PROGRAM_NAME}.service -# Create systemd config file -log_install ${DESTDIR}${ETCDIR}/env -mkdir -p ${DESTDIR}${ETCDIR} +# Create systemd/init.d config file +log_install ${DESTDIR}/etc/default/${PROGRAM_NAME} +mkdir -p ${DESTDIR}/etc/default cat ${TEMPLATE_DIR}/config \ | sed "s~{{ PROGRAM_NAME }}~${PROGRAM_NAME}~" \ - > ${DESTDIR}${ETCDIR}/env + > ${DESTDIR}/etc/default/${PROGRAM_NAME} # Create rsyslog file log_install ${RSYSLOGDIR}/49-${PROGRAM_NAME}.conf diff --git a/scripts/templates/config b/scripts/templates/config index 6ddab53..507377b 100644 --- a/scripts/templates/config +++ b/scripts/templates/config @@ -1,6 +1,6 @@ # Default settings for {{ PROGRAM_NAME }} # -# This is sourced by the systemd unit file. +# This is sourced by the systemd unit file or init.d # Command line flags to pass to {{ PROGRAM_NAME }} # First is IP to listen to, second is port. diff --git a/scripts/templates/sysunit.service b/scripts/templates/sysunit.service index 44d356e..c241166 100644 --- a/scripts/templates/sysunit.service +++ b/scripts/templates/sysunit.service @@ -3,7 +3,7 @@ Description={{ DESCRIPTION }} After=network.target [Service] -EnvironmentFile=-/etc/{{ PROGRAM_NAME }}/env +EnvironmentFile=-/etc/default/{{ PROGRAM_NAME }} Type=simple ExecStart={{ PROGRAM }} $OPTS Restart=on-failure