Questions tagged [systemd]

systemd is a modern replacement for the traditional Linux init. Its main features include the ability to express dependencies between services and aggressive parallelization of service startup.

systemd, created by Lennart Poettering and Kay Sievers, is a modern replacement for the traditional Linux init, whether System-V or BSD-style initscripts. Its main features include the ability to express dependencies between services and aggressive parallelization of service startup.

1471 questions
8
votes
1 answer

How to disable suspend on Ubuntu 20.04 (systemd) via CLI

I have a laptop that has been installed with ubuntu 20.04 that is being used as a server. Thus I want it to never suspend. By default it automatically suspends when the lid is closed. As I can only access it via ssh (and there is no X installed…
Sec
  • 387
  • 4
  • 13
8
votes
1 answer

How to make `needrestart` not defer restarting some services

With unattended-upgrades duly set up to automatically do upgrades, reboots and all, I'm stumped to find output like this in its daily report sometimes: ... Restarting services... /etc/needrestart/restart.d/systemd-manager systemctl restart…
cueedee
  • 215
  • 1
  • 8
8
votes
2 answers

SELinux blocking execution in systemd unit

I use Fedora 31 and tried to set up a Teamspeak server. When I look in journalctl -u teamspeak I get the following error: mar 09 22:22:46 melchior systemd[1]: Started Teamspeak server. mar 09 22:22:46 melchior systemd[20187]: teamspeak.service:…
runfalk
  • 261
  • 1
  • 3
  • 8
7
votes
2 answers

Why does systemd reject my unit name as 'neither a valid invocation ID nor unit name'?

I need to override the ExecStart Parameter of a systemd template. I have confirmed that the unit file exists & passes validation. Adding a unique-name@.service.d/override.conf file works well on some machines: user@prod-west-1604$ systemctl…
anx
  • 8,963
  • 5
  • 24
  • 48
7
votes
3 answers

systemctl shows service file not-found, even though .service file is present

I am running into a weird issue. I have a service file to start a custom application. systemctl command shows LOAD as not-found resource-service-prod-prod.service not-found active running resource-service-prod-prod.service however, file is…
CVVR
  • 71
  • 1
  • 1
  • 2
7
votes
1 answer

iptables-restore sometimes fails on reboot

Today and yesterday, my server automatically rebooted and failed to bring up the network device during boot. If I reboot the machine again, then it starts up fine, I've also not encountered any issues with this during the past 2 months. The only…
Sam Bull
  • 325
  • 4
  • 12
7
votes
3 answers

Systemd: Tell if script was run by systemd or by user

How can I tell if a script was called from systemd or from a user? I created a service for an old school daemon. We just switched to systemd and some of my admin like to call the rc-script directly. This won't work very well in the case of machine…
notes-jj
  • 248
  • 4
  • 9
7
votes
3 answers

Why doesn't MongoDB automatically restart?

It seems like MongoDB 3.6 isn't automatically configured to restart if it crashes. Looking at the systemd service that is bundled with the latest .deb package for Ubuntu 16.04LTS it doesn't seem to have restarts configured: $ sudo systemctl cat…
four43
  • 2,765
  • 2
  • 16
  • 17
7
votes
1 answer

Is it recommended to set OOMScoreAdjust=1000 in systemd for a replaceable service?

systemd has the OOMScoreAdjust option, which allows to adjust the oom-killer score of the started process. To quote from the systemd documentation: OOMScoreAdjust= Sets the adjustment level for the Out-Of-Memory killer for executed processes. Takes…
Philipp Claßen
  • 551
  • 2
  • 8
  • 21
7
votes
3 answers

Proper method to disable polkit.service on CentOS 7

Why? My services are started via proper unit files or init scripts. I have no need for regular users to do anything special on my servers beyond su. I am specifically looking for a way to completely shut down polkit without it starting up on it's…
Aaron
  • 2,859
  • 2
  • 12
  • 30
7
votes
1 answer

uWSGI won't start with systemd under Ubuntu 16.04

I'm in the process of doing a somewhat painful migration of our staging and production servers from Ubuntu 12.04 to 16.04. I'm testing the migration on staging and it is mostly working, except for getting uWSGI to start under systemd (it previously…
mathew
  • 213
  • 2
  • 7
7
votes
1 answer

cryptsetup cannot close mapped device

When I run: LANG=C cryptsetup --debug luksClose /dev/mapper/Pool-A it fails as follows: device-mapper: remove ioctl on Pool-A failed: Device or resource busy Device /dev/mapper/Pool-A is still in use. Command failed with code 16: Device or…
sebelk
  • 682
  • 4
  • 13
  • 32
7
votes
1 answer

Using systemd for Apache environment variables or SetEnv?

My System: CentOS 7.2.1511 (Core) Apache 2.4.6 I have quite a few environment variables I would like to add to Apache. I am currently doing it by adding into my /etc/httpd/conf.d/vhosts.conf file like so: SetEnv API_USERNAME…
Jeffrey Wen
  • 284
  • 3
  • 11
7
votes
2 answers

systemd Vagrant and VirtualBox: wait for synced folder to mount

I'm trying to setup a systemd service on a Vagrant box which requires the Vagrant synced folder to be mounted before starting. Vagrantfile Vagrant.configure(2) do |config| config.vm.box = "ubuntu/yakkety64" config.vm.synced_folder ".",…
rich remer
  • 489
  • 4
  • 11
7
votes
1 answer

How to make systemd call my "status" command?

We are replacing an Ubuntu 8.04 server with a Ubuntu 16.04. The server runs a single (non-OS) service that we need. (I'm the dev of that service, and not the sysadmin, which is on holiday this week) The service script looks about like…
monster
  • 618
  • 3
  • 10
  • 17