Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [systemd-unit]

Using Unit files from systemd.

Filter by
Sorted by
Tagged with
0 votes
0 answers
44 views

Systemd service as status control

I have a script which is supposed to be executed on boot when the network connection is established (local network would be sufficient). It is the shell version of linphone. This is my current unit ...
user avatar
  • 101
1 vote
1 answer
49 views

.service or crontab for shell script calling python-CLI app and/or python script failing

This isn't necessarily a Pi-specific question, but might be applicable to general Linux. However, my hunch is that the Pi's uniqueness might have something to do with it. I'm trying to run two scripts ...
user avatar
  • 113
1 vote
2 answers
1k views

Raspbian Stretch unable to start SSH on boot: Problem starting ssh on boot exit 255 when executing ssh -D $SSHD_OPTS?

When I boot my Raspberry pi running Stretch 9, the syntax checks out alright, but when it goes to start the following error is what it gets: pi@hostname:~ $ sudo systemctl status ssh.service * ssh....
user avatar
  • 694
2 votes
2 answers
1k views

How to run a script after bootup on RPi 4/Raspbian 10 (buster)

Im trying to run a script after bootup, when the desktop is shown. The script is rather simple: #!/bin/bash mkdir /home/pi/Desktop/test So in other words: This script is creating af folder "Test" ...
user avatar
  • 133
1 vote
1 answer
136 views

Refreshing lxsession kodi-standalone exit

I'm having difficulties refreshing a screen after kodi-standalone exits. I have a stretch-lite RPI2 installation and starting kodi from command line (with LXDE xserver gui present) mrkipi@raspberrypi:...
user avatar
0 votes
1 answer
354 views

Restart wifi using bash script and systemd service?

My rpi is connected to a captive portal hotspot. I have prepared a python login script to login to the captive portal and it was working fine. But sometimes the wifi is getting disconnected and at ...
user avatar
  • 73
1 vote
1 answer
2k views

Arecord: "main:828: device or resource busy" when run via systemd service, but works fine from CLI

I have a python script which, when a GPIO button is pressed, launches an arecord process. This records audio from a USB microphone (plughw:CARD=GS3,DEV=0) and pipes it to another program for ...
user avatar
1 vote
1 answer
348 views

Disable logging of dotnet core console output

I have a dotnet core application that is executed by a systemctl service. In normal operation it will always execute in this context. However the application may also be executed manually by the user ...
user avatar
0 votes
2 answers
429 views

How to make a service to run a python script which includes browser automation

I have python script which is using selenium web driver to do some web automation task. This python code is running perfectly fine when I am running it from the terminal. It launches firefox and does ...
user avatar
  • 362
2 votes
2 answers
551 views

Cleanly shutting down daemon on Reboot or Shutdown command

I have a daemon I've created which fires up a bunch of subcomponent threads. If I use the "systemctl stop" command I catch the SIGTERM and usually have everything closed down cleanly in 2-6 seconds (...
user avatar
  • 21
2 votes
2 answers
5k views

Python script does not run when called by service

I have written a python program that continuously parses my current IP and emails it to me if it changes that I want to begin running as soon as the computer boots up: /home/pi/sendIP.py#note that ...
user avatar
6 votes
3 answers
26k views

Running a script after an internet connection is established

I am trying to run a very small python script AFTER internet has been established. I am currently editing /etc/network/if-up.d/upstart by adding the following code directly under all_interfaces_up(): ...
user avatar
10 votes
2 answers
7k views

How to exit a python daemon cleanly?

I want a simple python script to run in background, therefore I configured daemon test.service in /etc/systemd/system/. [Unit] Description=Test service After=multi-user.target [Service] Type=simple ...
user avatar
  • 103
3 votes
1 answer
2k views

systemd never perform StartLimitAction (reboot) after service fails

I facing the same problem (which is similar to https://stackoverflow.com/questions/41908660/systemd-always-have-a-service-running-and-reboot-if-service-stops-more-than-x), having following service. I ...
user avatar