Skip to content
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

systemd: specify repo path, to avoid unnecessary subdirectory #7472

Merged
merged 1 commit into from Jun 16, 2020

Conversation

RubenKelevra
Copy link
Contributor

Reational

Currently, the service files will create a hidden directory '/var/lib/ipfs/.ipfs/' which is not necessary for a system-user installation since it won't store any additional files - like in a regular user directory.

This change will set the directory to '/var/lib/ipfs/' to avoid this.

@Stebalien
Copy link
Member

That's reasonable, but I'm pretty sure ~ isn't valid. You probably need "${HOME}".

@RubenKelevra
Copy link
Contributor Author

Well, ~ works fine for the service as well as in a shell. 🤔

I've tested it before I made the PR.

I thought IPFS makes the expansion, but it works without. The environment variable gets expanded by the system:

$ export IPFS_PATH=~
$ echo $IPFS_PATH
/home/ruben
$ /usr/bin/ipfs init
initializing IPFS node at /home/ruben
generating 2048-bit RSA keypair...done
peer identity: QmX35MVTjvJ3BxPABcphzsJJcPwUkKVL96icYP23mHgqWY
to get started, enter:

	ipfs cat /ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme

@Stebalien
Copy link
Member

Ah, you're right. go-ipfs does expand it (although I have no idea why). However, please use $HOME instead of relying on this. This is going to be very confusing for anyone reading the unit file.

@RubenKelevra
Copy link
Contributor Author

@Stebalien please rereview :)

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Stebalien Stebalien merged commit b431e69 into ipfs:master Jun 16, 2020
@RubenKelevra RubenKelevra deleted the feat/systemd_set_ipfs_path branch June 17, 2020 20:21
@aschmahmann aschmahmann mentioned this pull request Sep 22, 2020
72 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants