Questions tagged [systemd-service]

50 questions
1
vote
0 answers

Marking services for killing in a resource-starvation situation

We use systemd --user to run certain services of our own. In some cases, these "get out of hand" -- spawn way too many processes, which exhausts RAM and causes the machine to "thrash". When this happens, kernel tries to kill some processes, but is…
Mikhail T.
  • 2,338
  • 1
  • 24
  • 55
1
vote
0 answers

Run two scripts one after another with a systemd service

I have two scripts, what I would like to do is: at 1am, the first one runs once the first one stops, and this is a condition, the second one fires So, should i use: [Service] ExecStartPre = script.py ExecStart = secondscript.py or [Service] Type…
CrazyRabbit
  • 439
  • 4
  • 13
1
vote
1 answer

Run Systemd Service After Display Manager

I have a script that changes some Gnome settings which I want to run on startup. The script itself works fine when I run it manually, but I get the following error when I run it as a systemd service: ● startup-user.service - Startup Service …
grandinero
  • 113
  • 1
  • 5
1
vote
2 answers

Can't write to /tmp in systemd service with PrivateTmp=true

My apache2 service has PrivateTmp=true. When the service first starts it works fine, but after a few days, writing to /tmp fails with "no such file or directory". To debug I've tried running nsenter -t -m bash and I've confirmed that…
Thayne
  • 226
  • 1
  • 7
1
vote
2 answers

Restrict a user to only interact with a systemd service via Ansible

I want to have a user that is only able to start/stop/restart/status a service via an Ansible playbook. The playbook looks like this: host: my-server remote_user: my-user tasks: - name: "Start my-service" service: name: my-service …
MoaMoaK
  • 43
  • 1
  • 8
1
vote
0 answers

Generate systemd task on the fly

I'm writing a script to backup each mysql databases separately on from a mysql server, but instead of handling this inside the script I would like to rely on systemd to generate a backup job to get all the benefits from systemd (I/O, nice,…
0
votes
0 answers

Is it possible to set CPUAffinity=0 for a specific process in its systemd service unit file?

Is it possible to set CPUAffinity=0 for a specific process (lets say httpd.service) in its systemd service unit file?
0
votes
0 answers

Is it possible to delay a systemd service indefinitely by "After" clause?

Currently I am working on this issue: Service 1 is on another machine. Service 2 is on this machine but need Service 1 available to function. Service 3 is on this machine but need Service 2 to function. I want to make two automatic starting systemd…
George Y
  • 528
  • 6
  • 16
0
votes
1 answer

service file disappeared in Google CLoud VM

I have a Google VM micro instance running Ubuntu 20.04. Last week on this VM, I set up a systemd service that runs a python script. I created the service file (say my_fancy_service.service) as /lib/systemd/system/my_fancy_service.service and inside…
0
votes
0 answers

Systemd service file location for locally-built software

This might be a mostly aesthetic problem, but it's been bugging me enough to put a little more effort into resolving it. In my work environment, we rely very heavily on in-house developed software for Linux workstations and servers, and I've spent…
0
votes
1 answer

Possible to write a systemd service that starts when another service starts?

This seems like it should be a really simple question but I have had no luck in figuring it out. I have a service…
0
votes
0 answers

Debian Failed at step EXEC spawning - Systems Service - Permission Denied

I'm following this tutorial exactly line by line: https://docs.meilisearch.com/learn/cookbooks/running_production.html#step-4-run-meilisearch-as-a-service It has a step to setup the Meilisearch as a service using this config: cat << EOF >…
Jimmy
  • 269
  • 4
  • 7
  • 23
0
votes
1 answer

Systemd: why are files in /tmp or /run deleted after a few seconds?

I am using systemd to mount a Windows share using Kerberos. To make this work, I first run kinit in a .service file to create a Kerberos credential cache (ccache). The .service runs as root as the ccache needs to be owned by root (journalctl -xe…
0
votes
1 answer

How to monitor systemd?

I am looking for a way to monitor systemd services: Basic things such as whether they are running or not is a good start (and anything else on top is a bonus). I tried using node_exporter, but since I am running all my services rootless (systemctl…
Newskooler
  • 211
  • 1
  • 3
  • 14
0
votes
1 answer

systemd string formatting for instance parameter

I'm trying to set up a systemd service that takes a parameter, and uses it in a couple places. I think I'm very close: with my config file name myservice@.service, I can run systemctl start myservice@foo myservice@bar, and use %i in the config to…
ajwood
  • 101
  • 2