added systemd start script for debian build

This commit is contained in:
john30
2017-08-27 18:58:57 +02:00
parent 8c71d72b33
commit f1c5cdbd1a
4 changed files with 52 additions and 23 deletions
+6 -10
View File
@@ -4,13 +4,9 @@
# Options to pass to ebusd (run "ebusd -?" for more info):
EBUSD_OPTS="--scanconfig"
# In order to run multiple ebusd instances, simply define several EBUSD_OPTS
# with a unique suffix for each.
# Recommended is using a number as suffix for all EBUSD_OPTS settings.
# That number can then be used as additional "instance" parameter to the init.d
# script in order to start/stop an individual ebusd instance instead of all
# instances.
# Example (uncomment the EBUSD_OPTS above):
#EBUSD_OPTS1="--scanconfig -d /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A50285BI-if00-port0 -p 8888 -l /var/log/ebusd1.log"
#EBUSD_OPTS2="--scanconfig -d /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A900acTF-if00-port0 -p 8889 -l /var/log/ebusd2.log"
#EBUSD_OPTS3="--scanconfig -d /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A900beCG-if00-port0 -p 8890 -l /var/log/ebusd3.log"
# MULTIPLE EBUSD INSTANCES WITH SYSTEMD
# In order to run muiltiple ebusd instances on a systemd enabled system, just
# copy the /usr/lib/systemd/system/ebusd.service file to /etc/systemd/system/
# with a different name (e.g. ebusd-2.service), remove the line starting with
# 'EnvironmentFile=', and replace the '$EBUSD_OPTS' with the options for that
# particular ebusd instance.
+15 -8
View File
@@ -4,13 +4,20 @@
# Options to pass to ebusd (run "ebusd -?" for more info):
EBUSD_OPTS="--scanconfig"
# In order to run multiple ebusd instances, simply define several EBUSD_OPTS
# with a unique suffix for each.
# Recommended is using a number as suffix for all EBUSD_OPTS settings.
# That number can then be used as additional "instance" parameter to the init.d
# script in order to start/stop an individual ebusd instance instead of all
# instances.
# Example (uncomment the EBUSD_OPTS above):
# MULTIPLE EBUSD INSTANCES WITH SYSV
# In order to run multiple ebusd instances on a SysV enabled system, simply
# define several EBUSD_OPTS with a unique suffix for each. Recommended is to
# use a number as suffix for all EBUSD_OPTS settings. That number will then be
# taken as additional "instance" parameter to the init.d script in order to
# start/stop an individual ebusd instance instead of all instances.
# Example: (uncomment the EBUSD_OPTS above)
#EBUSD_OPTS1="--scanconfig -d /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A50285BI-if00-port0 -p 8888 -l /var/log/ebusd1.log"
#EBUSD_OPTS2="--scanconfig -d /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A900acTF-if00-port0 -p 8889 -l /var/log/ebusd2.log"
#EBUSD_OPTS3="--scanconfig -d /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A900beCG-if00-port0 -p 8890 -l /var/log/ebusd3.log"
#EBUSD_OPTS3="--scanconfig -d /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A900beCG-if00-port0 -p 8890 -l /var/log/ebusd3.log"
# MULTIPLE EBUSD INSTANCES WITH SYSTEMD
# In order to run muiltiple ebusd instances on a systemd enabled system, just
# copy the /usr/lib/systemd/system/ebusd.service file to /etc/systemd/system/
# with a different name (e.g. ebusd-2.service), remove the line starting with
# 'EnvironmentFile=', and replace the '$EBUSD_OPTS' with the options for that
# particular ebusd instance.
+14
View File
@@ -0,0 +1,14 @@
[Unit]
Description=ebusd, the daemon for communication with eBUS heating systems.
After=network.target
ConditionPathExists=/var/log
[Service]
Type=forking
Restart=always
PIDFile=/var/run/ebusd.pid
EnvironmentFile=-/etc/conf.d/ebusd
ExecStart=/usr/bin/ebusd $EBUSD_OPTS
[Install]
WantedBy=multi-user.target
+17 -5
View File
@@ -54,10 +54,17 @@ echo "*************"
echo " pack"
echo "*************"
echo
mkdir -p $RELEASE/DEBIAN $RELEASE/etc/init.d $RELEASE/etc/default $RELEASE/etc/ebusd $RELEASE/etc/logrotate.d || exit 1
mkdir -p $RELEASE/DEBIAN $RELEASE/etc/default $RELEASE/etc/ebusd $RELEASE/etc/logrotate.d || exit 1
rm $RELEASE/usr/bin/ebusfeed
cp contrib/debian/init.d/ebusd $RELEASE/etc/init.d/ebusd || exit 1
cp contrib/debian/default/ebusd $RELEASE/etc/default/ebusd || exit 1
if [ -d /run/systemd/system ]; then
mkdir -p $RELEASE/lib/systemd/system || exit 1
cp contrib/debian/systemd/ebusd.service $RELEASE/lib/systemd/system/ebusd.service || exit 1
cp contrib/debian/default/ebusd $RELEASE/etc/default/ebusd || exit 1
else
mkdir -p $RELEASE/etc/init.d || exit 1
cp contrib/debian/init.d/ebusd $RELEASE/etc/init.d/ebusd || exit 1
cp contrib/debian/default/ebusd $RELEASE/etc/default/ebusd || exit 1
fi
cp contrib/etc/ebusd/* $RELEASE/etc/ebusd/ || exit 1
cp contrib/etc/logrotate.d/ebusd $RELEASE/etc/logrotate.d/ || exit 1
cp ChangeLog.md $RELEASE/DEBIAN/changelog || exit 1
@@ -70,18 +77,23 @@ Architecture: $ARCH
Maintainer: John Baier <ebusd@ebusd.eu>
Homepage: https://github.com/john30/ebusd
Bugs: https://github.com/john30/ebusd/issues
Depends: libstdc++6 (>= 4.8.1), libc6, libgcc1$extralibs
Depends: logrotate, libstdc++6 (>= 4.8.1), libc6, libgcc1$extralibs
Description: eBUS daemon.
ebusd is a daemon for handling communication with eBUS devices connected to a
2-wire bus system.
EOF
cat <<EOF > $RELEASE/DEBIAN/dirs
/etc/ebusd
/etc/init.d
/etc/default
/etc/logrotate.d
/usr/bin
EOF
if [ -d /run/systemd/system ]; then
echo /lib/systemd/system >> $RELEASE/DEBIAN/dirs
else
echo /etc/init.d >> $RELEASE/DEBIAN/dirs
fi
cat <<EOF > $RELEASE/DEBIAN/postinst
#!/bin/sh
echo "Instructions:"