How do you apply .env.production changes?

I recently got my DNS set up with mailgun and I entered the information on the SMTP pages in .env.production with nano. I saved the file, but how do I update my mastodon instance so that it sees these changes? A user signed up the next day after I made the changes and they did not get an email confirmation, so I don’t think the changes were applied.

You need to restart ruby processes I am afraid.

How do I do that exactly? It seems like I can’t just run rails restart

Just stop mastodon and start again. It depends how you do that on your system. If you do start mastodon on system start, it will be the same usually with start replaced with stop and then start or just restart.

For some operating systems using the Linux kernel and a program called systemd there is an introduction how to do this in the official documentation:

1 Like

run below cmd and you good to go
sudo systemctl restart mastodon-*

Sometime restart cmd doesnt work in starting the services i encounter this during update so you can do them one by one i added the cmd below

systemctl stop mastodon-web && systemctl stop mastodon-streaming && systemctl stop mastodon-sidekiq

systemctl start mastodon-web && systemctl start mastodon-streaming && systemctl start mastodon-sidekiq
1 Like

I tried the first command and it didn’t work because the site was down so I tried the next two and it still didn’t work so I rebooted the server. Maybe I didn’t give it enough time or I should have only done the last two.

Edit: It looks like I didn’t wait long enough. I ran the last two commands and it worked after a minute.

I tried both commands now and they work.

you can also use systemctl reload-or-restart mastodon-{web,streaming,sidekiq}. mastodon-web in particular has an ExecRestart command defined so it should be a bit faster to reload it than to restart it entirely.