My strfry.service (path to strfry.conf issue)
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
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/"
Huge hats off to Doug, Mazin and the others that support this project. This really is an elegant nostr relay!
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!).
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
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.
thanks, problem fixed.