Hot answers tagged

3

Smartass response: apt-get install sysvinit-core Disclaimer: I have not done this on Buster, don't try it on an important system. Assuming you'd like to stick with the new default since Jessie, systemd, the init.d scripts are not the preferred method. Configuring a systemd service unit would be the way to go.


2

systemctl -l --no-pager status ..... -l, --full Do not ellipsize unit names, process tree entries, journal output, or truncate unit descriptions in the output of status, list-units, list-jobs, and list-timers. Also, show installation targets in the output of is-enabled. --no-pager Do not pipe output into a pager. should work.


2

Normally the systemd service of a timer is a oneshot or simple (default) start-up type, which means the service runs a command and exits afterwards. During the execution of the command given with ExecStart, the unit has the state active (running) and on exit something like inactive (dead). When using timers you do not activate the service with systemctl ...


2

A bug in the SELinux policy included with RHEL and CentOS 7 caused sudo to wait for exactly 25 seconds on each command. This bug was fixed with the selinux-policy-3.13.1-229.el7_6.10 package. You should create a new AMI with this package (and preferably the whole system) updated.


2

While it's better to figure out why sudo is slow and resolve that, you can group your commands together to only call sudo once. Inside your script, you could do something like this: sudo -Hu centos bash <<EOF somecommand somecommand2 morecommands EOF


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


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

I'm currently using Systemd 237 and it seems take into account [install] section overrides. At least links are created according to my drop-in file. /usr/lib/systemd/user/syncthing.service [Unit] Description=Syncthing - Open Source Continuous File Synchronization Documentation=man:syncthing(1) [Service] ExecStart=/usr/bin/syncthing -no-browser -no-...


1

I got the same result as you, but found that if I used blkio.throttle.{read|write}_bps_device that will limit throughput when the device is being used as a filesystem.


1

There is a typo in the unit file. The closing ] on the first line was missing. I added the char and now it works.


1

I received the same error message about 'neither a valid invocation ID nor unit name' when starting a service failed, but the fix was different than the accepted answer and unrelated to the bug. The error message was a total red-herring and a time waster as I explain below. My issue was with systemd netfilter-persistent service. The error message lead me ...


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