IMHO, you should include something like: # /etc/systemd/system/ipfs-daemon@.service [Unit] Description=InterPlanetary File System After=network.target [Service] ExecStart=/usr/bin/ipfs daemon --enable-gc --migrate ExecStop=/usr/bin/ipfs shutdown Group=%i Restart=always Type=simple User=%i [Install] WantedBy=multi-user.target So a user can simply: systemctl start ipfs-daemon@renich.service and have it launch. I've tested it and it works for me.
hello?
Sorry, I did the services for systemd & openrc long time ago but forgot about it, this week I will do the PR. btw, thanks for sharing your systemd service, it was very helpful, I don't have much experience writing systemd services.
(In reply to David from comment #2) > Sorry, I did the services for systemd & openrc long time ago but forgot > about it, this week I will do the PR. No worries. Just wanted to know happened. > btw, thanks for sharing your systemd service, it was very helpful, I don't > have much experience writing systemd services. Awesome! Glad to help!
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58150d2a90836290517b123f04f2930afd25016b commit 58150d2a90836290517b123f04f2930afd25016b Author: David Roman <davidroman96@gmail.com> AuthorDate: 2018-06-14 20:07:46 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2018-08-07 15:09:05 +0000 net-p2p/go-ipfs-bin: add services for openrc & systemd Closes: https://bugs.gentoo.org/643634 Closes: https://github.com/gentoo/gentoo/pull/9223 net-p2p/go-ipfs-bin/files/ipfs.confd | 1 + net-p2p/go-ipfs-bin/files/ipfs.init | 17 +++++++++++++++++ net-p2p/go-ipfs-bin/files/ipfs.service | 14 ++++++++++++++ ...in-0.4.15.ebuild => go-ipfs-bin-0.4.15-r1.ebuild} | 20 +++++++++++++++++++- 4 files changed, 51 insertions(+), 1 deletion(-)
Please reopen because it's not fixed. The included ipfs.service file is just plain wrong... It's rejected with status "bad-setting" by systemd. To fix this, either set "User=ipfs" and "Group=ipfs", or make it an instance unit by naming it "ipfs@.service" (the "@" is not a syntax error). In the latter case, "%i" is replaced by whatever comes between "@" and ".service". So if you "systemctl enable ipfs@someuser.service", it would run as "someuser" because %i resolves to "someuser". But using "%i" and not naming the service file as an instance template is just a syntax error. The "ipfs.init" file runs as user/group "ipfs" by default, so I guess you should provide both "ipfs@.service" (with %i as user/group) and "ipfs.service" (with static user/group). While fixing it, it should have "After=network.target" (the ipfs.init file also has it).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f02a3bf0a1f4c5d58fc553d9a85fe44229e1be76 commit f02a3bf0a1f4c5d58fc553d9a85fe44229e1be76 Author: Kai Krakow <kai@kaishome.de> AuthorDate: 2019-09-19 21:38:43 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2019-09-28 06:46:14 +0000 net-p2p/go-ipfs-bin: Bump to 0.4.22 Bump to 0.4.22 and fix systemd unit files on that way. This revision installs both variants, a user instance unit and a unit mirroring what the openrc version does (using the "ipfs" user). Closes: https://bugs.gentoo.org/643634 Package-Manager: Portage-2.3.69, Repoman-2.3.16 Signed-off-by: Kai Krakow <kai@kaishome.de> Signed-off-by: Joonas Niilola <juippis@gentoo.org> net-p2p/go-ipfs-bin/Manifest | 4 +++ net-p2p/go-ipfs-bin/files/ipfs-at.service | 18 ++++++++++ net-p2p/go-ipfs-bin/files/ipfs.service | 11 ++++-- net-p2p/go-ipfs-bin/go-ipfs-bin-0.4.22.ebuild | 51 +++++++++++++++++++++++++++ net-p2p/go-ipfs-bin/metadata.xml | 8 +++-- 5 files changed, 87 insertions(+), 5 deletions(-)