New answers tagged

0

I've googled right answer: https://mikewilliamson.wordpress.com/2015/08/26/running-a-rails-app-with-systemd-and-liking-it/ So, I have to add "/usr/bin/bash -lc" to command in ExecStart. It will be: ExecStart = /usr/bin/bash -lc '/usr/local/rvm/rubies/ruby-2.3.8/bin/bundle exec thin -e dev -R config.ru -p 7143 -P /var/run/onetime/onetime.pid -l /var/log/...


0

I think the target you're looking for is network-online.target. This should be active only after a network connection is up and usable.


0

Gateway and Address should be in the same Subnet: with your /run/systemd/network/10-netplan-ens3.network file they are not. Try setting ens3's address to 167.114.129.127/24.


0

You should call thin directly using the wrapper that RVM has provided for you. Without this, the system may end up running the wrong ruby, which indeed appears to be what happened. For example: ExecStart=/usr/bin/bash /usr/local/rvm/wrappers/%i/thin start <your options>


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"


0

I have now additionally created an override for a.service in /etc/systemd/system/a.service.d/override.conf which defines: [Unit] BindsTo=b.service Like this, a full dependency a if and only if b is fulfilled.


0

Similar to your solution, but a bit simpler: Run systemctl edit vbox@.service --full --force and paste the following content in, updating User and Group to your username. Description=Virtual Box Guest %I After=network.target vboxdrv.service Before=runlevel2.target shutdown.target [Service] User=USERNAME Group=GROUPNAME Type=forking Restart=no TimeoutSec=...


0

On Ubuntu you can find it at /lib/systemd/system/mysql.service I once tried to run the command systemctl enable mysql.service, but found that it searches for the file at /etc/systemd/system/ (where usually there's a hard link for it there) and in my case there was no mysql.service file there. So I created a hard link with: ln -T /lib/systemd/system/...


0

Have you tried PathChanged ? PathChanged= may be used to watch a file or directory and activate the configured unit whenever it changes. It is not activated on every write to the watched file but it is activated if the file which was open for writing gets closed. PathModified= is similar, but additionally it is activated also on simple writes to the ...


0

Two alternative solutions to the problem: 1- rebooting with systemctl --force --force reboot or 2- without reboot, just moving session files mv /run/systemd/system/session-*.scope /tmp/


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


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

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 "...


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 ...


Top 50 recent answers are included