Home Man
Search
Today's Posts
Register

If you're not sure where to post a Unix or Linux question, post it here. All unix and Linux beginners welcome in this forum!

Run one service after another service has finished - systemd

Tags
systemd, systemd-timer

👤 Login to reply

 
Thread Tools Search this Thread
# 1  
Old 10-05-2017
Run one service after another service has finished - systemd

Hi all
I would like to know how to run task2.service after task1.service has finished.

task1.service has a timer (task1.timer), that makes it run every 5 minutes
Code:
OnCalendar=*:0/5

task2.service is basically a script, that has to work on the files created after task1 has finished.
This is what I have so far:
Code:
# task2.service

[Unit]
Description=Task2
After=network.target

[Service]
Type=oneshot
ExecStart=/media/script.sh
TimeoutStartSec=1min30s

Now, I don't know if I need a timer for task2 too, or if I should include under [Unit]
Code:
Requires=task1.service
After=network.target task1.service

Any help would be appreciated!
# 2  
Old 10-05-2017
why not have task 1 start task 2. just make sure that the previous task2 is complete before starting another task1
# 3  
Old 10-06-2017
I would like to understand the way systemd works and I would like to learn it that way, if it is possible. Thank you.
👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Service xitrum Solaris 2 11-16-2015 01:06 PM
FTP service/ set up messi777 UNIX for Dummies Questions & Answers 2 10-12-2011 04:06 AM
FTP service..please help me lipbalm UNIX for Dummies Questions & Answers 2 07-27-2008 09:13 AM


All times are GMT -4. The time now is 05:19 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password