From b395da5fdb5b31c05c1f261da7e2b7d8f98aa423 Mon Sep 17 00:00:00 2001 From: Santiago Castro Date: Wed, 14 Aug 2024 17:30:55 -0700 Subject: [PATCH 1/9] Fix socket selection verbose logging message (#652) --- src/base/TcpSocketHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/TcpSocketHandler.cpp b/src/base/TcpSocketHandler.cpp index e50dd5c08..f4a83a10a 100644 --- a/src/base/TcpSocketHandler.cpp +++ b/src/base/TcpSocketHandler.cpp @@ -84,7 +84,7 @@ int TcpSocketHandler::connect(const SocketEndpoint &endpoint) { select(sockFd + 1, NULL, &fdset, NULL, &tv); if (FD_ISSET(sockFd, &fdset)) { - VLOG(4) << "sockFd " << sockFd << "is selected" << sockFd; + VLOG(4) << "sockFd " << sockFd << " is selected"; int so_error; socklen_t len = sizeof so_error; From 345f6cb1bd2d60a4c289edb27a22741d7318fd6a Mon Sep 17 00:00:00 2001 From: Santiago Castro Date: Wed, 14 Aug 2024 18:06:04 -0700 Subject: [PATCH 2/9] Fix missing space in log INFO message (#650) --- src/terminal/ParseConfigFile.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terminal/ParseConfigFile.hpp b/src/terminal/ParseConfigFile.hpp index 5cb0b5f06..613334375 100644 --- a/src/terminal/ParseConfigFile.hpp +++ b/src/terminal/ParseConfigFile.hpp @@ -1183,7 +1183,7 @@ static void local_parse_file(const char *targethost, struct Options *options, ifstream infile(filename); if (!infile.good()) { - LOG(INFO) << filename << "not found"; + LOG(INFO) << filename << " not found"; return; } From 2099bdcf330cae40b98a13370b4de84a1b98f134 Mon Sep 17 00:00:00 2001 From: Jason Gauci Date: Sun, 15 Sep 2024 21:26:36 -0500 Subject: [PATCH 3/9] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 38fed0183..0eb69c3b0 100644 --- a/README.md +++ b/README.md @@ -201,13 +201,11 @@ et dev:8000 -jport 9000 (etserver running on port 9000 on jumphost) To build Eternal Terminal on Mac, the easiest way is to grab dependencies with Homebrew: ``` -brew install --only-dependencies MisterTea/et/et +brew install autoconf automake libtool git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git cd EternalTerminal mkdir build cd build -# Add if it doesn't work on Apple Silicon but should work without it -if [[ $(uname -a | grep 'arm\|aarch64') ]]; then export VCPKG_FORCE_SYSTEM_BINARIES=1; fi cmake ../ make && sudo make install ``` From 198ca2c00da8a8448a7b726cf7f226fe0e9ed82c Mon Sep 17 00:00:00 2001 From: Jason Gauci Date: Sun, 13 Oct 2024 07:01:22 -0500 Subject: [PATCH 4/9] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0eb69c3b0..b97c0007c 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ The easiest way to install is using Homebrew: brew install MisterTea/et/et ``` +If the install fails on including csignal, see https://github.com/MisterTea/EternalTerminal/issues/662#issuecomment-2408889829 + Then if you want a daemon to launch `etserver` on every boot: On m1 (Apple Silicon) Macs: From 204612857d233496e7a9c146fd540b7a45599ec7 Mon Sep 17 00:00:00 2001 From: gkiessling Date: Thu, 24 Oct 2024 14:53:49 -0700 Subject: [PATCH 5/9] Added autoconf and libtool dependencies to Debian/Ubuntu build instructions in README.md (#670) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b97c0007c..dab07cb47 100644 --- a/README.md +++ b/README.md @@ -227,7 +227,7 @@ Grab the deps and then follow this process. Debian/Ubuntu Dependencies: ``` -sudo apt install libboost-dev libsodium-dev \ +sudo apt install libboost-dev libsodium-dev autoconf libtool \ libprotobuf-dev protobuf-compiler libgflags-dev libutempter-dev libcurl4-openssl-dev \ build-essential ninja-build cmake git zip ``` From 5fe8767953e7f86d2a7f545387d45bf6eff0c7e6 Mon Sep 17 00:00:00 2001 From: timsu92 <33785401+timsu92@users.noreply.github.com> Date: Sun, 17 Nov 2024 03:40:55 +0800 Subject: [PATCH 6/9] Speedup build process (#672) * Remove packages not required in Ubuntu * Ignore previous commits to speedup download * Parallel compiling --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index dab07cb47..3d48ba888 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ Install dependencies: Download and install from source: ``` -git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git +git clone --recurse-submodules --depth 1 https://github.com/MisterTea/EternalTerminal.git cd EternalTerminal mkdir build cd build @@ -204,12 +204,12 @@ To build Eternal Terminal on Mac, the easiest way is to grab dependencies with H ``` brew install autoconf automake libtool -git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git +git clone --recurse-submodules --depth 1 https://github.com/MisterTea/EternalTerminal.git cd EternalTerminal mkdir build cd build cmake ../ -make && sudo make install +make -j$(nproc) && sudo make install ``` To run an `et` server for testing, run `./etserver`. To run an `et` @@ -227,27 +227,27 @@ Grab the deps and then follow this process. Debian/Ubuntu Dependencies: ``` -sudo apt install libboost-dev libsodium-dev autoconf libtool \ - libprotobuf-dev protobuf-compiler libgflags-dev libutempter-dev libcurl4-openssl-dev \ +sudo apt install libsodium-dev autoconf libtool \ + libprotobuf-dev protobuf-compiler libutempter-dev libcurl4-openssl-dev \ build-essential ninja-build cmake git zip ``` Fetch source, build and install: ``` -git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git +git clone --recurse-submodules --depth 1 https://github.com/MisterTea/EternalTerminal.git cd EternalTerminal mkdir build cd build # For ARM (including OS/X with apple silicon): if [[ $(uname -a | grep 'arm\|aarch64') ]]; then export VCPKG_FORCE_SYSTEM_BINARIES=1; fi cmake ../ -make package +make -j$(nproc) package sudo dpkg --install *.deb sudo cp ../etc/et.cfg /etc/ ``` -Once built, the binary only requires `libgflags-dev` and `libprotobuf-dev`. +Once built, the binary only requires `libprotobuf-dev`. ### CentOS 7 @@ -268,7 +268,7 @@ sudo yum install devtoolset-11 devtoolset-11-libatomic-devel rh-git227 Download and install from source ([see #238 for details](https://github.com/MisterTea/EternalTerminal/issues/238)): ``` -git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git +git clone --recurse-submodules --depth 1 https://github.com/MisterTea/EternalTerminal.git cd EternalTerminal mkdir build cd build From 3b58bfb8b5cd351f76cecc39704199d5dbccfb54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20F=C3=B6rster?= Date: Tue, 19 Nov 2024 23:06:22 +0100 Subject: [PATCH 7/9] updates install instructions for debian (#675) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated install instructions in allignment to: https://wiki.debian.org/DebianRepository/UseThirdParty - Markdown cleanup Signed-off-by: Toni FoĢˆrster --- README.md | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 3d48ba888..5ced71ebd 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,6 @@ sudo cp ../init/launchd/homebrew.mxcl.et.plist /Library/LaunchDaemons/homebrew.m sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.et.plist ``` - Alternatively, a package is available in MacPorts: ``` @@ -62,14 +61,14 @@ sudo apt-get install et Or see "Debian/Ubuntu" below to install and build from source (e.g., for ARM). - ### Debian -For debian, use our deb repo. For buster: +For Debian, use our deb repo: ``` -echo "deb https://github.com/MisterTea/debian-et/raw/master/debian-source/ buster main" | sudo tee -a /etc/apt/sources.list.d/et.list -curl -sSL https://github.com/MisterTea/debian-et/raw/master/et.gpg | sudo tee /etc/apt/trusted.gpg.d/et.gpg >/dev/null +echo "deb [signed-by=/etc/apt/keyrings/et.gpg] https://mistertea.github.io/debian-et/debian-source/ $(grep VERSION_CODENAME /etc/os-release | cut -d= -f2) main" | sudo tee -a /etc/apt/sources.list.d/et.list +sudo mkdir -m 0755 -p /etc/apt/keyrings # only if you're using Debian 11 or older +curl -sSL https://github.com/MisterTea/debian-et/raw/master/et.gpg | sudo tee /etc/apt/keyrings/et.gpg >/dev/null sudo apt update sudo apt install et ``` @@ -86,6 +85,7 @@ sudo dnf install et ``` ### FreeBSD + On FreeBSD, use: ``` @@ -110,14 +110,14 @@ zypper in EternalTerminal Install dependencies: -* Fedora (tested on 25): +- Fedora (tested on 25): ``` sudo dnf install boost-devel libsodium-devel protobuf-devel \ protobuf-compiler cmake gflags-devel libcurl-devel ``` -* Gentoo: +- Gentoo: ``` sudo emerge dev-libs/boost dev-libs/libsodium \ @@ -138,7 +138,7 @@ sudo make install ### Windows -Eternal Terminal works under WSL (Windows Subsystem for Linux). Follow the ubuntu instructions. +Eternal Terminal works under WSL (Windows Subsystem for Linux). Follow the ubuntu instructions. ### Docker Image @@ -148,7 +148,7 @@ See [docker/README.md](docker/) Verify that the client is installed correctly by looking for the `et` executable: `which et`. -Verify that the server is installed correctly by checking the service status: `systemctl status et`. On some operating systems, you may need to enable and start the service manually: `sudo systemctl enable --now et`. +Verify that the server is installed correctly by checking the service status: `systemctl status et`. On some operating systems, you may need to enable and start the service manually: `sudo systemctl enable --now et`. You are ready to start using ET! @@ -163,20 +163,25 @@ ET uses ssh for handshaking and encryption, so you must be able to ssh into the ET uses TCP, so you need an open port on your server. By default, it uses 2022. Once you have an open port, the syntax is similar to ssh. Username is default to the current username starting the et process, use `-u` or `user@` to specify a different if necessary. + ``` et hostname (etserver running on default port 2022, username is the same as current) et user@hostname:8000 (etserver running on port 8000, different user) ``` + You can specify a jumphost and the port et is running on jumphost using `--jumphost` and `--jport`. If no `--jport` is given, et will try to connect to default port 2022. + ``` et hostname -jumphost jump_hostname (etserver running on port 2022 on both hostname and jumphost) et hostname:8888 --jumphost jump_hostname --jport 9999 ``` + Additional arguments that et accept are port forwarding pairs with option `-t "18000:8000, 18001-18003:8001-8003"`, a command to run immediately after the connection is setup through `-c`. Starting from the latest release, et supports parsing both user-specific and system-wide ssh config file. The config file is required when your sshd on server/jumphost is listening on a port which is not 22. Here is an example ssh config file showing how to setup when + - there is a jumphost in the middle - sshd is listening on a port which is not 22 - connecting to a different username other than current one. @@ -212,7 +217,7 @@ cmake ../ make -j$(nproc) && sudo make install ``` -To run an `et` server for testing, run `./etserver`. To run an `et` +To run an `et` server for testing, run `./etserver`. To run an `et` server daemon persistently across reboots: ``` @@ -249,10 +254,10 @@ sudo cp ../etc/et.cfg /etc/ Once built, the binary only requires `libprotobuf-dev`. - ### CentOS 7 Install dependencies: + ``` sudo yum install epel-release sudo yum install cmake3 boost-devel libsodium-devel protobuf-devel \ @@ -261,12 +266,14 @@ sudo yum install cmake3 boost-devel libsodium-devel protobuf-devel \ ``` Install scl dependencies + ``` sudo yum install centos-release-scl sudo yum install devtoolset-11 devtoolset-11-libatomic-devel rh-git227 ``` Download and install from source ([see #238 for details](https://github.com/MisterTea/EternalTerminal/issues/238)): + ``` git clone --recurse-submodules --depth 1 https://github.com/MisterTea/EternalTerminal.git cd EternalTerminal @@ -280,7 +287,7 @@ sudo cp ../etc/et.cfg /etc/ Find the actual location of et: - which etserver + which etserver Correct the service file (see [#180](https://github.com/MisterTea/EternalTerminal/issues/180) for details). @@ -290,7 +297,7 @@ sudo sed -ie "s|ExecStart=[^[:space:]]*[[:space:]]|ExecStart=$(which etserver) | Alternativelly, open the file /etc/systemd/system/et.service in an editor and correct the `ExectStart=...` line to point to the correct path of the `etserver` binary. - ExecStart=/usr/local/bin/etserver --cfgfile=/etc/et.cfg + ExecStart=/usr/local/bin/etserver --cfgfile=/etc/et.cfg Reload systemd configs: @@ -317,4 +324,3 @@ If you have any problems with installation or usage, please [file an issue on gi - Jason Gauci: https://github.com/MisterTea - Ailing Zhang: https://github.com/ailzhang - James Short: https://github.com/jshort - From 17d6867c89f212bef1e0e968b171f74b83a9f28d Mon Sep 17 00:00:00 2001 From: coandco Date: Sun, 24 Nov 2024 13:02:24 -0800 Subject: [PATCH 8/9] Update Dockerfiles to use a modern distro and the offical package (#658) * Update Dockerfiles to use a modern distro and the offical package * Add comments and small optimizations * Make sure openssh-server and the proper rundir are created before starting --- docker/Dockerfile.client | 41 +++++++++++++-------------------- docker/Dockerfile.server | 45 +++++++++++++------------------------ docker/container-entrypoint | 5 +++++ 3 files changed, 35 insertions(+), 56 deletions(-) diff --git a/docker/Dockerfile.client b/docker/Dockerfile.client index 63cea76bf..1063eb1ff 100644 --- a/docker/Dockerfile.client +++ b/docker/Dockerfile.client @@ -1,30 +1,19 @@ -FROM centos:8 as base +FROM debian:bookworm-slim + +# Use ADD to avoid having to install curl +ADD --chmod=644 https://github.com/MisterTea/debian-et/raw/master/et.gpg /etc/apt/trusted.gpg.d/et.gpg + +# Use a run cache to speed up rebuilding and avoid having to remove the cache when we're done +RUN --mount=type=cache,mode=0755,target=/var/lib/apt/lists,sharing=locked \ + --mount=type=cache,mode=0755,target=/var/cache/apt,sharing=locked \ + rm -f /etc/apt/apt.conf.d/docker-clean && \ + echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && \ + apt-get update -qq && \ + apt-get install -y ca-certificates && \ + echo "deb https://github.com/MisterTea/debian-et/raw/master/debian-source/ bookworm main" > /etc/apt/sources.list.d/et.list && \ + apt-get update -qq && \ + apt-get install -y et openssh-server -ENV BUILD_REPOS="epel-release centos-release-scl" \ - BUILD_DEPS="cmake3 boost-devel libsodium-devel protobuf-devel \ - protobuf-compiler gflags-devel protobuf-lite-devel git \ - perl-IPC-Cmd perl-Data-Dumper libunwind-devel libutempter-devel \ - devtoolset-11 devtoolset-11-libatomic-devel rh-git227" - - -WORKDIR / - -RUN yum install -y $BUILD_REPOS && \ - yum install -y $BUILD_DEPS && \ - git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git && \ - cd EternalTerminal && \ - mkdir build && \ - cd build && \ - bash -c "scl enable devtoolset-11 rh-git227 'cmake3 ../'" && \ - bash -c "scl enable devtoolset-11 'make -j $(grep ^processor /proc/cpuinfo |wc -l) && make install'" - -FROM centos:8 - -RUN yum install -y epel-release && \ - yum install -y protobuf-lite libsodium libatomic libunwind - -COPY --from=base /usr/bin/etserver /usr/bin/etterminal /usr/bin/htm /usr/bin/htmd /usr/bin/ -COPY --from=base /EternalTerminal/etc/et.cfg /etc/et.cfg COPY --chmod=755 container-entrypoint /bin/container-entrypoint ENTRYPOINT ["/bin/container-entrypoint", "client"] diff --git a/docker/Dockerfile.server b/docker/Dockerfile.server index 62a41edc3..cd77e0e41 100644 --- a/docker/Dockerfile.server +++ b/docker/Dockerfile.server @@ -1,34 +1,19 @@ -FROM centos:8 as base +FROM debian:bookworm-slim + +# Use ADD to avoid having to install curl +ADD --chmod=644 https://github.com/MisterTea/debian-et/raw/master/et.gpg /etc/apt/trusted.gpg.d/et.gpg + +# Use a run cache to speed up rebuilding and avoid having to remove the cache when we're done +RUN --mount=type=cache,mode=0755,target=/var/lib/apt/lists,sharing=locked \ + --mount=type=cache,mode=0755,target=/var/cache/apt,sharing=locked \ + rm -f /etc/apt/apt.conf.d/docker-clean && \ + echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && \ + apt-get update -qq && \ + apt-get install -y ca-certificates && \ + echo "deb https://github.com/MisterTea/debian-et/raw/master/debian-source/ bookworm main" > /etc/apt/sources.list.d/et.list && \ + apt-get update -qq && \ + apt-get install -y et openssh-server -ENV BUILD_REPOS="epel-release centos-release-scl" \ - BUILD_DEPS="cmake3 boost-devel libsodium-devel protobuf-devel \ - protobuf-compiler gflags-devel protobuf-lite-devel git \ - perl-IPC-Cmd perl-Data-Dumper libunwind-devel libutempter-devel \ - devtoolset-11 devtoolset-11-libatomic-devel rh-git227" - - -WORKDIR / - -RUN yum install -y $BUILD_REPOS && \ - yum install -y $BUILD_DEPS && \ - git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git && \ - cd EternalTerminal && \ - mkdir build && \ - cd build && \ - bash -c "scl enable devtoolset-11 rh-git227 'cmake3 ../'" && \ - bash -c "scl enable devtoolset-11 'make -j $(grep ^processor /proc/cpuinfo |wc -l) && make install'" - -FROM centos:8 - -RUN yum install -y epel-release && \ - yum install -y protobuf-lite libsodium openssh-server libatomic libunwind - -COPY --from=base /usr/bin/etserver /usr/bin/etterminal /usr/bin/htm /usr/bin/htmd /usr/bin/ -COPY --from=base /EternalTerminal/etc/et.cfg /etc/et.cfg COPY --chmod=755 container-entrypoint /bin/container-entrypoint -EXPOSE 2022 2222 - ENTRYPOINT ["/bin/container-entrypoint", "server"] - -CMD ["--cfgfile=/etc/et.cfg"] diff --git a/docker/container-entrypoint b/docker/container-entrypoint index e4be87096..f1f233f56 100755 --- a/docker/container-entrypoint +++ b/docker/container-entrypoint @@ -3,6 +3,11 @@ set -x if [ "$1" == server ]; then + if [ ! -d /run/sshd ]; then + mkdir /run/sshd + chmod 0755 /run/sshd + fi + /usr/sbin/sshd shift exec etserver --logtostdout -v 1 "$@" From 120b8cb8ca09801e657f38b104e3c1ded8885a15 Mon Sep 17 00:00:00 2001 From: timsu92 <33785401+timsu92@users.noreply.github.com> Date: Mon, 25 Nov 2024 05:04:45 +0800 Subject: [PATCH 9/9] Include systemd files in the final built package (#674) * Include systemd files in the final built package * Fix instructions regarding to systemd service --- CMakeLists.txt | 8 +++++++- README.md | 7 ++++--- debian/postinst | 32 ++++++++++++++++++++++++++++++++ debian/postrm | 21 +++++++++++++++++++++ debian/prerm | 7 +++++++ 5 files changed, 71 insertions(+), 4 deletions(-) create mode 100755 debian/postinst create mode 100755 debian/postrm create mode 100755 debian/prerm diff --git a/CMakeLists.txt b/CMakeLists.txt index 07d2ac9ba..beb2648d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -635,8 +635,14 @@ set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) set(CPACK_PACKAGE_INSTALL_DIRECTORY "EternalTerminal") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") -SET(CPACK_GENERATOR "STGZ;TGZ;TZ;DEB") +if(NOT CPACK_GENERATOR) + SET(CPACK_GENERATOR "STGZ;TGZ;TZ;DEB") +endif() +SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/debian/postinst;${CMAKE_SOURCE_DIR}/debian/postrm;${CMAKE_SOURCE_DIR}/debian/prerm") +SET(CPACK_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR}/systemctl;/lib/systemd/system" "${CMAKE_SOURCE_DIR}/etc;/etc") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Unmaintained") +SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libprotobuf-dev, libc6 (>= 2.34), libgcc-s1 (>= 3.3.1), libstdc++6 (>= 12), libutempter0 (>= 1.1.5)") +SET(CPACK_DEBIAN_PACKAGE_SUGGESTS "systemd") # This must always be last! include(CPack) diff --git a/README.md b/README.md index 5ced71ebd..d8dfbabb3 100644 --- a/README.md +++ b/README.md @@ -234,7 +234,7 @@ Debian/Ubuntu Dependencies: ``` sudo apt install libsodium-dev autoconf libtool \ libprotobuf-dev protobuf-compiler libutempter-dev libcurl4-openssl-dev \ - build-essential ninja-build cmake git zip + build-essential ninja-build cmake git zip pkg-config ``` Fetch source, build and install: @@ -246,14 +246,15 @@ mkdir build cd build # For ARM (including OS/X with apple silicon): if [[ $(uname -a | grep 'arm\|aarch64') ]]; then export VCPKG_FORCE_SYSTEM_BINARIES=1; fi -cmake ../ +cmake -DCPACK_GENERATOR=DEB ../ make -j$(nproc) package sudo dpkg --install *.deb -sudo cp ../etc/et.cfg /etc/ ``` Once built, the binary only requires `libprotobuf-dev`. +Disable et server by `sudo systemctl disable --now et` + ### CentOS 7 Install dependencies: diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 000000000..ce9d7525d --- /dev/null +++ b/debian/postinst @@ -0,0 +1,32 @@ +#!/bin/sh +set -e +# Automatically added by dh_installsystemd/13.6ubuntu1 +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then + # This will only remove masks created by d-s-h on package removal. + deb-systemd-helper unmask 'et.service' >/dev/null || true + + # was-enabled defaults to true, so new installations run enable. + if deb-systemd-helper --quiet was-enabled 'et.service'; then + # Enables the unit on first installation, creates new + # symlinks on upgrades if the unit file has changed. + deb-systemd-helper enable 'et.service' >/dev/null || true + else + # Update the statefile to add new symlinks (if any), which need to be + # cleaned up on purge. Also remove old symlinks. + deb-systemd-helper update-state 'et.service' >/dev/null || true + fi +fi +# End automatically added section +# Automatically added by dh_installsystemd/13.6ubuntu1 +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then + if [ -d /run/systemd/system ]; then + systemctl --system daemon-reload >/dev/null || true + if [ -n "$2" ]; then + _dh_action=restart + else + _dh_action=start + fi + deb-systemd-invoke $_dh_action 'et.service' >/dev/null || true + fi +fi +# End automatically added section diff --git a/debian/postrm b/debian/postrm new file mode 100755 index 000000000..676d30ce0 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,21 @@ +#!/bin/sh +set -e +# Automatically added by dh_installsystemd/13.6ubuntu1 +if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then + systemctl --system daemon-reload >/dev/null || true +fi +# End automatically added section +# Automatically added by dh_installsystemd/13.6ubuntu1 +if [ "$1" = "remove" ]; then + if [ -x "/usr/bin/deb-systemd-helper" ]; then + deb-systemd-helper mask 'et.service' >/dev/null || true + fi +fi + +if [ "$1" = "purge" ]; then + if [ -x "/usr/bin/deb-systemd-helper" ]; then + deb-systemd-helper purge 'et.service' >/dev/null || true + deb-systemd-helper unmask 'et.service' >/dev/null || true + fi +fi +# End automatically added section diff --git a/debian/prerm b/debian/prerm new file mode 100755 index 000000000..aceccd45e --- /dev/null +++ b/debian/prerm @@ -0,0 +1,7 @@ +#!/bin/sh +set -e +# Automatically added by dh_installsystemd/13.6ubuntu1 +if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then + deb-systemd-invoke stop 'et.service' >/dev/null || true +fi +# End automatically added section