strfry icon indicating copy to clipboard operation
strfry copied to clipboard

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

Open hashratez opened this issue 2 years ago • 6 comments

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 avatar Apr 23 '23 15:04 hashratez

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 avatar Apr 23 '23 15:04 hashratez

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

hashratez avatar Apr 23 '23 15:04 hashratez

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!).

hoytech avatar Apr 24 '23 20:04 hoytech

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

Darecjo avatar Oct 01 '23 07:10 Darecjo

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.

hoytech avatar Oct 01 '23 14:10 hoytech

thanks, problem fixed.

Darecjo avatar Oct 02 '23 02:10 Darecjo