Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Debian Package Services and Config Directory #1855

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9d6b770
debian add initial systemd service
DaAwesomeP Apr 20, 2023
693dc63
debian/ola.postinst: add --home parameter to adduser invocation
yoe Apr 21, 2014
14d6d7e
debian remove debconf from init script, add OLAD_OPTS
DaAwesomeP Apr 20, 2023
2758515
debian move config to /etc/ola
DaAwesomeP Apr 20, 2023
48d7dfb
Don't use debconf for this
yoe Apr 21, 2014
12090e6
More debconf removals
yoe Jun 30, 2015
84282f4
add rdm_test_server systemd service
DaAwesomeP Apr 20, 2023
9ffb314
debian systemd services user, rdm_test_server service configurable args
DaAwesomeP Apr 21, 2023
896b13f
debian systemd services wait for network, olad
DaAwesomeP Apr 21, 2023
bd89102
update Debian compat level
DaAwesomeP Apr 21, 2023
e905f02
debian dh-autoreconf superseeds autotools-dev
DaAwesomeP Apr 21, 2023
d24b096
debian rules remove autotools_dev but keep package
DaAwesomeP Apr 21, 2023
886c092
Debian stick with debhelper 12
DaAwesomeP Apr 21, 2023
24d2cec
Debian add override_dh_installsystemd
DaAwesomeP Apr 21, 2023
977dca8
Merge branch 'master' into DaAwesomeP-debian-systemd-and-config-dir
DaAwesomeP Jun 18, 2023
b31073a
debian update Makefile dist files list
DaAwesomeP Jun 18, 2023
146a9d1
debian update Makefile dist files list again
DaAwesomeP Jun 18, 2023
8729000
Merge remote-tracking branch 'upstream/master' into DaAwesomeP-debian…
DaAwesomeP Jun 22, 2023
1740d5a
add build name generation and bake into build
DaAwesomeP Jun 22, 2023
0bf40e7
Merge branch 'DaAwesomeP-debian-systemd-and-config-dir' of github.com…
DaAwesomeP Jun 22, 2023
b66a17a
build name move git check to script (can be used outside of autoconf)
DaAwesomeP Jun 22, 2023
f903797
github actions debian use git describe for version
DaAwesomeP Jun 22, 2023
938733c
github actions debian git build name fix env assignment
DaAwesomeP Jun 22, 2023
5111428
github actions debian git build name fix env assignment typo
DaAwesomeP Jun 22, 2023
dab152a
github actions debian build name fix step reference
DaAwesomeP Jun 22, 2023
0f3cf4b
github actions debian separate build name from debian version, no bac…
DaAwesomeP Jun 22, 2023
c4c97a2
github actions debian try git describe in action
DaAwesomeP Jun 22, 2023
46cb35e
github actions debian git security precaution fix
DaAwesomeP Jun 22, 2023
66ba156
github actions debian remove test git describe, add dash to debian bu…
DaAwesomeP Jun 22, 2023
c6a521a
allow overriding build name
DaAwesomeP Jun 22, 2023
cc2be83
github actions debian build name no dirty, create changelong entry
DaAwesomeP Jun 22, 2023
f134516
github actions debian preserve build name in builduser
DaAwesomeP Jun 22, 2023
4e6477a
github actions debian build force explicit previous version
DaAwesomeP Jun 22, 2023
23e29c3
github actions checkout full to create useful OLA_BUILD_NAME
DaAwesomeP Jun 23, 2023
60f615f
github actions debian build name in artifacts
DaAwesomeP Jun 23, 2023
3a3db2e
github actions debian include tag name in artifact name in case Debia…
DaAwesomeP Jun 23, 2023
28469df
github actions test update apt
DaAwesomeP Jun 23, 2023
059bc44
script build name include dirty flag
DaAwesomeP Jul 11, 2023
8015767
github actions debian build version do not append debian version if n…
DaAwesomeP Jul 11, 2023
49d4d44
build name script debian version move os ver suffix to script
DaAwesomeP Jul 12, 2023
2abcdb8
Merge branch 'master' into DaAwesomeP-debian-systemd-and-config-dir
DaAwesomeP Jul 13, 2023
cb606a0
Merge remote-tracking branch 'origin/master' into DaAwesomeP-debian-s…
DaAwesomeP Oct 23, 2023
dda1a02
debian systemd rdm-test use env file
DaAwesomeP Nov 9, 2023
26844bb
Merge remote-tracking branch 'upstream/master' into DaAwesomeP-debian…
DaAwesomeP Nov 9, 2023
e83dca1
Merge branch 'master' into DaAwesomeP-debian-systemd-and-config-dir
DaAwesomeP Feb 26, 2024
8aacbd4
Merge branch 'master' into DaAwesomeP-debian-systemd-and-config-dir
DaAwesomeP Apr 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
ola (0.11.0-1) UNRELEASED; urgency=medium
DaAwesomeP marked this conversation as resolved.
Show resolved Hide resolved
* debian/ola.postinst: add --home parameter to adduser invocation
* This change pulled from Debian by Perry Naseck <git@perrynaseck.com>
https://salsa.debian.org/wouter/ola/-/commit/b9a0e2ab290d64f215891e1d543079dd78e7125e
* Remove debconf usage
* This change pulled from Debian by Perry Naseck <git@perrynaseck.com>
https://salsa.debian.org/wouter/ola/-/commit/6d27c071547426536b6f8f0db193dcfd7a4e5991
* This change pulled from Debian by Perry Naseck <git@perrynaseck.com>
191514d233d2300674df7e9c3febb35c2890c50c

-- Perry Naseck <git@perrynaseck.com> Thu, 20 Apr 2023 18:47:03 -0400

ola (0.10.9-2) UNRELEASED; urgency=medium

* Fix ola-rdm-tests Debian package by patching python shebangs to python3
Expand Down
1 change: 0 additions & 1 deletion debian/compat

This file was deleted.

2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: ola
Priority: optional
Maintainer: Wouter Verhelst <wouter@debian.org>
Uploaders: RenZO <renzo@imaginux.com>
Build-Depends: debhelper (>= 13), autotools-dev, dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy
Build-Depends: debhelper-compat (= 12), autotools-dev, dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy
yoe marked this conversation as resolved.
Show resolved Hide resolved
Standards-Version: 3.9.8
Section: libs
Vcs-Git: https://github.com/OpenLightingProject/ola.git
Expand Down
30 changes: 0 additions & 30 deletions debian/ola-rdm-tests.config

This file was deleted.

1 change: 1 addition & 0 deletions debian/ola-rdm-tests.dirs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
etc/ola
usr/bin
usr/lib
usr/share
64 changes: 0 additions & 64 deletions debian/ola-rdm-tests.postinst

This file was deleted.

7 changes: 1 addition & 6 deletions debian/ola-rdm-tests.rdm_test_server.init
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$CMD.pid
DESC="OLA RDM Test Server"
USER=olad
DAEMON_ARGS="--world-writable"

# Reads config file (will override defaults above)
[ -r /etc/default/ola-rdm-tests ] && . /etc/default/ola-rdm-tests

if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then
DAEMON_ARGS="--world-writeable"
elif [ "$1" = "start" ] || [ "$1" = "stop" ] ; then
echo "The init script is currently inactive;\nuse \"dpkg-reconfigure ola-rdm-tests\" to change this." >&2
fi

[ -x "$DAEMON" ] || exit 0

. /lib/lsb/init-functions
Expand Down
13 changes: 13 additions & 0 deletions debian/ola-rdm-tests.rdm_test_server.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Open Lighting Architecture RDM Test Server
Documentation=man:olad(1)
After=network.target remote-fs.target olad.service
Wants=olad.service

[Service]
User=olad
Environment=RDM_TEST_SERVER_OPTS="--world-writable"
yoe marked this conversation as resolved.
Show resolved Hide resolved
ExecStart=/usr/bin/rdm_test_server.py $RDM_TEST_SERVER_OPTS

[Install]
WantedBy=multi-user.target
10 changes: 0 additions & 10 deletions debian/ola-rdm-tests.templates

This file was deleted.

30 changes: 0 additions & 30 deletions debian/ola.config

This file was deleted.

1 change: 1 addition & 0 deletions debian/ola.dirs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
etc/ola
usr/bin
usr/lib
usr/share/olad/www
Expand Down
19 changes: 7 additions & 12 deletions debian/ola.olad.init
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ PIDFILE=/var/run/$NAME.pid
DESC="OLA daemon"
USER=olad
LOG_LEVEL=3
CONFIG_DIR="/var/lib/ola/conf"
CONFIG_DIR="/etc/ola"
OLAD_OPTS=""

# Reads config file (will override defaults above)
[ -r /etc/default/ola ] && . /etc/default/ola

if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then
DAEMON_ARGS="--syslog --log-level $LOG_LEVEL --config-dir $CONFIG_DIR"
elif [ "$1" = "start" ] || [ "$1" = "stop" ] ; then
echo "The init script is currently inactive;\nuse \"dpkg-reconfigure ola\" to change this." >&2
fi
DAEMON_ARGS="--syslog --log-level $LOG_LEVEL --config-dir $CONFIG_DIR $OLAD_OPTS"

[ -x "$DAEMON" ] || exit 0

Expand All @@ -43,12 +40,10 @@ case "$1" in
;;
stop)
# master switch
if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then
log_daemon_msg "Stopping $DESC" "$NAME"
/sbin/start-stop-daemon --stop --pidfile $PIDFILE --chuid $USER --exec $DAEMON --retry 10
/bin/rm -f $PIDFILE
log_end_msg $?
fi
log_daemon_msg "Stopping $DESC" "$NAME"
/sbin/start-stop-daemon --stop --pidfile $PIDFILE --chuid $USER --exec $DAEMON --retry 10
/bin/rm -f $PIDFILE
log_end_msg $?
;;
reload|force-reload|restart)
$0 stop && $0 start
Expand Down
16 changes: 16 additions & 0 deletions debian/ola.olad.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Open Lighting Architecture daemon
Documentation=man:olad(1)
After=network.target remote-fs.target network-online.target
Wants=network-online.target

[Service]
User=olad
Environment=LOG_LEVEL=3
Environment=CONFIG_DIR=/etc/ola
Environment=OLAD_OPTS=
ExecStart=/usr/bin/olad --log-level $LOG_LEVEL --config-dir $CONFIG_DIR $OLAD_OPTS
Restart=on-failure

[Install]
WantedBy=multi-user.target
65 changes: 3 additions & 62 deletions debian/ola.postinst
Original file line number Diff line number Diff line change
@@ -1,74 +1,15 @@
#!/bin/sh -e
# postinst script for ola

conffile="/etc/default/ola"

update_config_file() {
db_field=$1
config_field=$2

RET=false
db_get $db_field
if [ -n "$RET" ] ; then
if grep -q "^$config_field" $conffile ; then
# keep any admin changes, while replacing the variable content
sed "s/^[ ]*$config_field=\".*\"/$config_field=\"$RET\"/" < $conffile > $conffile.new &&
mv $conffile.new $conffile
else
echo "$config_field=\"$RET\"" >> $conffile
fi
fi
}

# Source debconf library -- we have a Depends line
# to make sure it is there...
. /usr/share/debconf/confmodule
db_version 2.0

case "$1" in
configure)
if [ -f $conffile ] ; then
sed -i -e 's/^[ ]*DAEMON/RUN_DAEMON/g' $conffile
else
cat << EOF > $conffile
# Defaults for ola initscript (/etc/init.d/ola)
# This is a POSIX shell fragment

# [automatically edited by postinst, do not change line format ]

# ola daemon switch. If set to true, olad will run.
RUN_DAEMON="true"
EOF
fi

update_config_file ola/daemon RUN_DAEMON

db_stop
;;

abort-upgrade|abort-remove|abort-deconfigure)
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

#create the olad user, add it to groups
getent passwd olad > /dev/null || adduser --system --no-create-home olad
getent passwd olad > /dev/null || adduser --system --home /usr/lib/olad --no-create-home olad
getent group olad > /dev/null || addgroup --system olad
groups olad | grep dialout > /dev/null || adduser olad dialout
groups olad | grep plugdev > /dev/null || adduser olad plugdev

# setup the config dir
CONF_DIR=/var/lib/ola
if [ ! -d ${CONF_DIR} ]; then
mkdir -p ${CONF_DIR};
chown -R olad:olad ${CONF_DIR};
chmod g+s ${CONF_DIR};
fi;

chown -R olad:olad /etc/ola
chmod g+s /etc/ola

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
Expand Down
10 changes: 0 additions & 10 deletions debian/ola.templates

This file was deleted.

6 changes: 5 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
export VERBOSE=1

%:
dh $@ --parallel --with autotools_dev,autoreconf,bash_completion,python3
yoe marked this conversation as resolved.
Show resolved Hide resolved
dh $@ --parallel --with bash_completion,python3

override_dh_auto_configure:
dh_auto_configure -- --enable-python-libs --enable-rdm-tests CXXFLAGS='-Wno-error=deprecated-declarations -Wno-error=unused-parameter' pythondir='/usr/lib/python3/dist-packages'
Expand All @@ -20,6 +20,10 @@ override_dh_installinit:
dh_installinit -p ola --name=olad
dh_installinit -p ola-rdm-tests --name=rdm_test_server

override_dh_installsystemd:
dh_installsystemd -p ola --name=olad
dh_installsystemd -p ola-rdm-tests --name=rdm_test_server

override_dh_makeshlibs:
dh_makeshlibs -V

Expand Down
Loading