Skip to content

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

Merged
Stebalien merged 1 commit intoipfs:masterfrom
RubenKelevra:feat/systemd_set_ipfs_path
Jun 16, 2020
Merged

systemd: specify repo path, to avoid unnecessary subdirectory#7472
Stebalien merged 1 commit intoipfs:masterfrom
RubenKelevra:feat/systemd_set_ipfs_path

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 RubenKelevra force-pushed the feat/systemd_set_ipfs_path branch from e5b884b to b47ecd0 Compare June 15, 2020 22:51
@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.

3 participants