2

I have two processes that need to run under different conditions (Service1 has to be run from a specific TTY and service2 cannot be run under that TTY.) so they have to be run from different systemd services. But I want them to run back to back. So I want to trigger just service1 with a timer but then I want service2 to be triggered right after service1.

Is there a graceful way to achieve this?

Service1

[Unit]
Description=blank the cursor

[Service]
StandardInput=tty-force 
StandardOutput=tty 
TTYPath=/dev/tty1 
Type=simple 
ExecStart=tput civis > /dev/tty1

Service2

[Unit]
Description=random wallpaper change script

[Service]
SyslogIdentifier=wallpaper.sh
User=deanresin
Type=simple 
ExecStart=/bin/bash /home/deanresin/scripts/wallpaper.sh

I want service1 to trigger service2 after it completes.

2

The Arch Linux wiki used to suggest the following to trigger the reload of the HTTP server after certbot renew:

ExecStartPost=/bin/systemctl reload nginx.service

I'll not say this is "graceful" but adding the following to service1.service can do what you would like to do:

ExecStartPost=/bin/systemctl start service2.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.