Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to write a systemd timer to run Prey. I wrote:

prey.service:

[Unit]
Description=Open source anti-theft solution for laptops, phones & tablets.

[Service]
ExecStart=/usr/share/prey-tracker/prey.sh

prey.timer:

[Unit]
Description=Open source anti-theft solution for laptops, phones & tablets.

[Timer]
OnStartupSec=5min
OnUnitActiveSec=1h

[Install]
WantedBy=basic.target

It seems to work, but I'm in doubt about the [Install] section. There's a network.target. Does it mean that If I replace basic.target with network.target the timer will start running when the systems has network connection? If that is the case, can I remove the OnStartupSec=5min line?

share|improve this question

The network.target is just a generic unit other services can depend on. It depends on the services, which are required by the network.target. If the network.target requires NetworkManager, it only ensures NetworkManager is started before any network dependent service is started.

share|improve this answer
    
So it doesn't ensure that the system has network connection? – Tae Oct 15 '13 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .