You are not logged in.

#1 2015-03-12 15:32:41

steelcowboy
Member
From: California, USA
Registered: 2014-09-04
Posts: 48

[SOLVED] Repo-Add systemd service

Hi all,

After spending 7 hours compiling chromium-dev, I found out how amazingly simple it is to create a repo and have my aur helper, aura, automatically put compiled packages there! It's actually pretty cool having my own AUR repo (for select packages, of course), but the problem is I don't want to run the repo-add command every time. So I wrote up a quick .path file:

[Unit]
Description=Watch the aur repo for changes

[Path]
PathModified=/srv/http/aur

[Install]
WantedBy=multi-user.target 

And a corresponding service file:

[Unit]
Description=Monitors the AUR repo for changes

[Service]
ExecStart=/usr/bin/repo-add -n /srv/http/aur/steelrepo.db.tar.gz /srv/http/aur/*.pkg.tar.xz
Restart=on-failure

[Install]
WantedBy=multi-user.target 

At first, after starting and enabling repo-add.path, I got the error for the service that the start request repeated too quickly. I added the restart on failure line, but now I see

Mar 12 08:17:33 steelhorse systemd[1]: repoadd.service failed.
Mar 12 08:17:33 steelhorse repo-add[4262]: ==> Extracting database to a temporary location...
Mar 12 08:17:33 steelhorse repo-add[4262]: ==> ERROR: File '/srv/http/aur/*.pkg.tar.xz' not found.
Mar 12 08:17:33 steelhorse repo-add[4262]: ==> No packages modified, nothing to do.
Mar 12 08:17:33 steelhorse repo-add[4284]: ==> Extracting database to a temporary location...
Mar 12 08:17:33 steelhorse repo-add[4284]: ==> ERROR: File '/srv/http/aur/*.pkg.tar.xz' not found.
Mar 12 08:17:33 steelhorse repo-add[4284]: ==> No packages modified, nothing to do.
Mar 12 08:17:33 steelhorse systemd[1]: repoadd.service: main process exited, code=exited, status=1/FAILURE
Mar 12 08:17:33 steelhorse systemd[1]: Unit repoadd.service entered failed state.
Mar 12 08:17:33 steelhorse systemd[1]: repoadd.service failed. 

This was when I ran aura to add a package. The command I placed in the service file worked just fine in the terminal, so I don't know why systemd is having trouble with it. Any suggestions? Better solutions? Thanks!

Last edited by steelcowboy (2015-03-12 16:45:45)

Offline

#2 2015-03-12 15:37:51

mychris
Member
From: Munich
Registered: 2012-09-15
Posts: 68

Re: [SOLVED] Repo-Add systemd service

Systemd services do not run in a shell. systemd will call the binary with the given arguments without globs or anything else. The * will not expand like in a shell environment.

Offline

#3 2015-03-12 16:13:23

steelcowboy
Member
From: California, USA
Registered: 2014-09-04
Posts: 48

Re: [SOLVED] Repo-Add systemd service

Ah, that makes sense. What can I do then to make it add all new packages?

Offline

#4 2015-03-12 16:30:29

mychris
Member
From: Munich
Registered: 2012-09-15
Posts: 68

Re: [SOLVED] Repo-Add systemd service

You can create a shell script and execute that instead of /usr/bin/repo-add

https://wiki.archlinux.org/index.php/Sy … process.3F

Last edited by mychris (2015-03-12 16:31:23)

Offline

#5 2015-03-12 16:40:26

steelcowboy
Member
From: California, USA
Registered: 2014-09-04
Posts: 48

Re: [SOLVED] Repo-Add systemd service

That worked perfectly! Thank you very much for your help!

Last edited by steelcowboy (2015-03-12 16:45:20)

Offline

#6 2015-03-12 16:55:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Repo-Add systemd service

Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB