Kharacternyk / pacwall

A live wallpaper that shows the dependency graph and status of installed packages.
GNU General Public License v3.0
556 stars 33 forks source link

Failure in the systemd timer unit #50

Closed mhklv closed 4 years ago

mhklv commented 4 years ago

I have enabled and started pacwall-watch-updates.timer unit, but the wallpaper doesn't seem to change as packages get outdated. And indeed I have several entries like this in my journalctl approximately every hour:

systemd[849]: Starting Pacwall Wallpaper Generator...
Sep 16 06:53:18 SwiftNB systemd[849]: pacwall@-.service: Main process exited, code=exited, status=1/FAILURE
Sep 16 06:53:18 SwiftNB systemd[849]: pacwall@-.service: Failed with result 'exit-code'.
Sep 16 06:53:18 SwiftNB pacwall[22034]: USAGE: /usr/bin/pacwall [-ugk]
Sep 16 06:53:18 SwiftNB pacwall[22034]: See /usr/share/doc/pacwall/README.rst for more info.
Sep 16 06:53:18 SwiftNB systemd[849]: Failed to start Pacwall Wallpaper Generator.

I see that pacwall-watch-updates.timer executes pacwall@-.service periodically, so here is a little more info from systemctl --user status pacwall@-.service:

● pacwall@-.service - Pacwall Wallpaper Generator
     Loaded: loaded (/usr/lib/systemd/user/pacwall@.service; static)
     Active: failed (Result: exit-code) since Wed 2020-09-16 21:15:59 MSK; 5s ago
TriggeredBy: ● pacwall-watch-updates.timer
    Process: 33891 ExecStart=/usr/bin/pacwall -/ (code=exited, status=1/FAILURE)
   Main PID: 33891 (code=exited, status=1/FAILURE)

Sep 16 21:15:59 SwiftNB systemd[849]: Starting Pacwall Wallpaper Generator...
Sep 16 21:15:59 SwiftNB pacwall[33891]: USAGE: /usr/bin/pacwall [-ugk]
Sep 16 21:15:59 SwiftNB pacwall[33891]: See /usr/share/doc/pacwall/README.rst for more info.
Sep 16 21:15:59 SwiftNB systemd[849]: pacwall@-.service: Main process exited, code=exited, status=1/FAILURE
Sep 16 21:15:59 SwiftNB systemd[849]: pacwall@-.service: Failed with result 'exit-code'.
Sep 16 21:15:59 SwiftNB systemd[849]: Failed to start Pacwall Wallpaper Generator.

So it tries to run /usr/bin/pacwall -/ and fails because of the invalid argv. From what I can tell a dash - gets replaced in the %I variable by a slash / in pacwall@.service. Then in /usr/lib/systemd/user/pacwall@.service I replaced

ExecStart=/usr/bin/pacwall -%I

with

ExecStart=/usr/bin/pacwall -%i

Ran systemctl --user daemon-reload and now systemctl --user start pacwall@-.service doesn't throw any errors. Are there any specific reasons for using %I instead of %i?

Kharacternyk commented 4 years ago

Thanks for investigating it. I should have checked journalctl --user more often. I substituted %i for %I some time ago because of this excerpt from the manual:

"%I"      │ Unescaped instance name                       │ Same as "%i", but with escaping undone.

I thought that I don't need any escaping. Now it turns out that I got exactly what I would call escaping by using %I.

I'll revert to %i.