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

My strfry.service (path to strfry.conf issue) #36

Open
hashratez opened this issue Apr 23, 2023 · 6 comments
Open

My strfry.service (path to strfry.conf issue) #36

hashratez opened this issue Apr 23, 2023 · 6 comments

Comments

@hashratez
Copy link

hashratez commented Apr 23, 2023

I read the home page (https://github.com/hoytech/strfry) and the deploy page for installation (https://github.com/hoytech/strfry/blob/master/docs/DEPLOYMENT.md). For me, the inferred methodology, is slightly different between the two pages. So I made a user and installed under a user (which seems to be the indication from the home page) whereas on the deployment page you install as no login.

Anyway, I am running Ubuntu 22.04 and for the life of me I could not get the relay to run as a service only as logging in and executing ./strfry relay from the install directory.

After 4-5 hours of banging my head against the wall I found the problem it was the path to the config file, this is how I got it work work. The user is "strfry" and the packages are installed is his home directory.

sudo nano /etc/systemd/system/strfry.service

[Unit]
Description=strfry relay service

[Service]
ExecStart=/home/strfry/strfry/strfry --config=/home/strfry/strfry/strfry.conf relay
LimitNOFILE=1000000
LimitNPROC=1000000

[Install]
WantedBy=multi-user.target
@hashratez
Copy link
Author

hashratez commented Apr 23, 2023

In the strfry.conf file I did also update the db entry although it seemed to run ok as is. I did put full path to the db. From the instructions: Edit the db = "./strfry-db/" line to: db = "/var/lib/strfry/"

db = "/home/strfry/strfry/"

@hashratez
Copy link
Author

Huge hats off to Doug, Mazin and the others that support this project. This really is an elegant nostr relay!

@hoytech
Copy link
Owner

hoytech commented Apr 24, 2023

Thanks! I think the DEPLOYMENT file might be assuming you put the config file in /etc/strfry.conf since that is one of the default locations searched. We should probably make those instructions a bit more clear (pull requests welcome!).

@Darecjo
Copy link

Darecjo commented Oct 1, 2023

even though i put the config file in /etc/strfry.conf the service couldn't start also same thing happened with @hashratez

Edited:
The problem is with the nofiles attribute when requesting it from the system it comes higher than it should be
Screenshot 2023-10-01 at 4 27 40 PM

@hoytech
Copy link
Owner

hoytech commented Oct 1, 2023

Easiest fix is to reduce the value nofiles parameter in strfry.conf. Set it to 524288 or lower.

Alternatively, you can try raising the LimitNOFILE in the systemd unit, although you might have to adjust some other system-specific limits.

@Darecjo
Copy link

Darecjo commented Oct 2, 2023

thanks, problem fixed.

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

No branches or pull requests

3 participants