New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net-p2p/go-ipfs-bin: add services for openrc & systemd #9223
Conversation
4a07880
to
9a7758b
Compare
net-p2p/go-ipfs-bin/files/ipfs.init
Outdated
need net | ||
} | ||
|
||
start() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using the various openrc variables instead of caling start-stop-daemon directly (possibly leaving out start() and stop(). A nice example: https://github.com/gentoo/gentoo/blob/master/dev-db/redis/files/redis.initd-5
net-p2p/go-ipfs-bin/files/ipfs.init
Outdated
command="/usr/bin/ipfs" | ||
command_args="daemon --enable-gc --migrate" | ||
command_user="ipfs:ipfs" | ||
start_stop_daemon_args="--wait 1000 -b -e IPFS_PATH=${IPFS_PATH} \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused. Do you really need to explicitly make openrc pass this over? Wouldn't it be enough to export
it in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? When openrc export something it's also visible to to the service without the need of the -e
option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't test it in detail but AFAIU the mechanics of it, I don't see why it wouldn't be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw some services was using it, so just in case I did the same. There were not any special reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, have you tested that it works without it? ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I forgot the export
keyword. At first I didn't deleted the default path and I thought it was working. Sorry :P
ccb44e0
to
13d028b
Compare
newconfd "${FILESDIR}/ipfs.confd" ipfs | ||
|
||
keepdir /var/log/ipfs | ||
fowners -R ipfs:ipfs /var/log/ipfs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>>> Install go-ipfs-bin-0.4.15 into /tmp/portage/net-p2p/go-ipfs-bin-0.4.15/image/ category net-p2p
chown: invalid user: ‘ipfs:ipfs’
In other words, you're creating the user after this. Also, please use diropts
instead of fowners
post creation.
You have two options:
- Cheaper: create the user in
pkg_setup
. - Smarter: forget the above about
diropts
, create the user and dofowners
inpkg_preinst
. Then the user won't be needed when building a binary package but will be present for install.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second option seems also more nice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this is a major enough change to deserve a revbump.
enewgroup ipfs | ||
enewuser ipfs "" "" /var/lib/ipfs ipfs | ||
|
||
elog 'To be able to use the ipfs service you will need to create the ipfs repository' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still belongs in postinst.
elog '(eg: su -s /bin/sh -c "ipfs init -e" ipfs)' | ||
elog 'or change IPFS_PATH of /etc/conf.d/ipfs with another with proper permissions.' | ||
|
||
keepdir /var/log/ipfs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keepdir
stays in install, only fowners
needs to move.
Pull request CI report Report generated at: 2018-08-07 15:01 UTC No issues found |
Thanks! |
Closes: https://bugs.gentoo.org/643634
Original PR was closed because of the github incident.