[arch-general] systemd user unit files from custom directory

Damjan Georgievski gdamjan at gmail.com
Sat Jan 30 12:41:48 UTC 2016


On 30 January 2016 at 12:48, Andre "Osku" Schmidt
<andre.osku.schmidt at gmail.com> wrote:
> hello,
>
> thought i'd ask here first, in case it's a distro problem.
>
> was wondering if we can use systemd to start and stop a daemon for
> testing purposes during development. meaning, i would like to not have
> to "install" my daemon nor its systemd service file, and instead run
> all from the working directory.
>
> from systemd.unit man page i got the impression that this example would work:
>
> ❱ tree $PWD
> /data/projects/hmm
> └── systemd
>     └── user
>         └── foobar.service
>
> ❱ cat systemd/user/foobar.service
> [Unit]
> Description=Foo Bar
> [Service]
> ExecStart=/usr/bin/sleep 42
>
> ❱ XDG_CONFIG_HOME=$PWD systemctl --user start foobar
> Failed to start foobar.service: Unit foobar.service failed to load: No
> such file or directory.
>
> am i doing it wrong, or?

the daemon reads and starts the service not systemctl.
in recent versions of systemd you can symlink the service file from
ouside ~/.config/systemd/ too

ps.
what exactly are you testing? there's also systemd-run


-- 
damjan


More information about the arch-general mailing list