OnUnitActiveSec= tells systemd how long to wait after the service the timer is activating was last activated.OnStartupSec=, on the other hand, tells systemd how long to wait after systemd was started before starting the service.OnActiveSec=, which tells systemd how long to wait after the timer itself is activated before starting the service.In this case, the OnBootSec is the directive you need to tell systemd to run the service after boot has finished. The section is new, but it is pretty self-explanatory: it contains information on when the service will be triggered and the service to trigger. Jumping in at the deep end, your minetest.timer unit will look like this:ĭescription=Runs the rvice 1 minute after boot upĪs usual, you have a section with a description of what the unit does. The reason for this could be that, as you want your service to do other stuff, like send emails to the players telling them the game is available, you will want to make sure other services (like the network) are fully up and running before doing anything fancy. So you will “improve” your Minetest set up by creating a timer that will run the game’s server 1 minute after boot up has finished instead of right away. If you haven’t read those articles yet, you may want to go and give them a look now. Let’s expand the Minetest service you set up in the first two articles of this series as our first example on how to use timer units. Although similar to cron jobs, systemd timers are slightly more flexible. Timers add yet another way of starting services, based on… well, time. Previously, we saw how to enable and disable systemd services by hand, at boot time and on power down, when a certain device is activated, and when something changes in the filesystem.
0 Comments
Leave a Reply. |