[systemd-devel] Restart and RestartSec in packaged .service files

Mathieu Bridon bochecha at fedoraproject.org
Thu Sep 1 03:02:39 PDT 2011


On Thu, 2011-09-01 at 11:50 +0200, Reindl Harald wrote:
> 
> Am 01.09.2011 11:45, schrieb Jan Willies:
> > 2011/9/1 Reindl Harald <h.reindl at thelounge.net <mailto:h.reindl at thelounge.net>>
> > 
> >     also having the restart-options but no way to set them without
> >     override the whole .service file is simply a unfinished design
> > 
> > That's not true. You can include the original service file and just add/overwrite your specific settings
> 
> how will you do that?

Let's say you want to add Restart=always to foobar.service, waht you'd
do is:
  1. edit /etc/systemd/system/foobar.service (to overwrite the /lib one)
  2. write this in the file:
      .include /lib/systemd/system/foobar.service
      Restart=always

That's it, you only added your option, and the rest comes from the
package manager.

This is all explained in the manual:
  - http://0pointer.de/public/systemd-man/systemd.unit.html
  - or simply: man systemd.unit


-- 
Mathieu




More information about the systemd-devel mailing list