Florian Lindner wrote: > Andrei Borzenkov wrote: > >> В Tue, 19 Aug 2014 22:08:26 +0200 >> Florian Lindner <mailingli...@xgm.de> пишет: >> >>> Andrei Borzenkov wrote: >>> >>> > В Tue, 19 Aug 2014 20:59:55 +0200 >>> > Florian Lindner <mailingli...@xgm.de> пишет: >>> > >>> >> >>> >> I also try to set up a matching timer: >>> >> >>> >> systemctl --user start git-commit@/home/florian/timer.test.timer >>> >> >>> >> works fine, but: >>> >> >>> >> systemctl --user enable git-commit@/home/florian/timer.test.timer >>> >> Failed to execute operation: Invalid argument >>> >> >>> >> Or is creating a target for the timer and set WantedBy in the service >>> >> file the way to go? But still, why is starting working, but not >>> >> enabling? >>> >> >>> > >>> > Does your unit have [Install] section? >>> >>> No. >>> >> >> "systemctl enable" creates links listed in [Install] section; how do >> expect it to work in this case? > > The timer I try to enable contains a Install section. > > > florian@asaru ~/.config/systemd/user % cat git-commit@.timer > [Unit] > Description=Timer to commit all changes in instance. > > [Timer] > OnUnitActiveSec=5min > OnActiveSec=5min > AccuracySec = 5min > > [Install] > WantedBy=default.target > florian@asaru ~/.config/systemd/user % systemctl --user enable git- > commit@/home/florian/timer.test.timer > Failed to execute operation: Invalid argument > > > Is my assumption that instance argument (the path) is derived from the > timer to the unit wrong?
I was expecting that the timer unit A@B.timer calls the service unit A@B.service. It seems to work fine with path units, as proposed by Anthony. Enabling a A@.timer works fine, but A@B.timer fails with the error message above. A Install section is present (btw, systemd gives a more verbose error message if a Install section is missing on enable). Curious, while systemctl --user enable git-commit@.timer gives no error message and zero return code, it does not place a link in default.target.wants... Sorry for my confusion...! _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel