Hot answers tagged

2

I'm also looking for a more elegant solution. There is an open systemd ticket for Request for enhancement here: https://github.com/systemd/systemd/issues/5966 Currently my workaround is as follow: B.service Requisite=A.service After=A.service A.service OnFailure=Stop-B.service Stop-B.service [Service] Type=oneshot TimeoutSec=0 ExecStart=/bin/systemctl ...


2

systemctl daemon-reload cannot be run on a single unit file. What it does is reloading the systemd configurations of unit files, rerun all generators and recreates the dependency tree. I guess since the dependency tree is regenerated it doesn't make sense to run this on a single unit as several unit files may have changed and the dependency tree then could ...


1

According to me, the best solution is to improve the monitor program. If you only check for process name in pid list, then it is not enough. Instead change monitor program to behave like a client of application A, and do a very quick and simple action in application A to be really sure it is operational, and if not, just redirect immediately users to ...


1

Try ExecStartPre=/bin/sh -c "/usr/sbin/ipset restore < /etc/ipset-blacklist/ip-blacklist.restore"


1

As suggested by Lenniey (i was writing the script). You can create another systemd service and timer to make checks. Your script may look something like #!/bin/bash SERVICE="sshd.service" LIMIT=9 PID=$(systemctl show ${SERVICE} | grep ExecMainPID|cut -d '=' -f2) NBFD=$(ls -l /proc/${PID}/fd | wc -l) if [[ ( $NBFD > $LIMIT ) ]] ; then echo "...


1

Starting with systemd v239, you can use drop-ins https://github.com/systemd/systemd/commit/5396624506e155c4bc10c0ee65b939600860ab67 # mkdir -p /etc/systemd/system/user-.slice.d # cat > /etc/systemd/system/user-.slice.d/50-memory.conf << EOF [Slice] MemoryMax=1G EOF # systemctl daemon-reload


Only top voted, non community-wiki answers of a minimum length are eligible