FreeBSD on mastodon part 2
While FreeBSD mastodon package was great, it also broke our server!
When we ran pkg upgrade, the ruby version got bumped. But mastodon needs a specific ruby version to run, and there goes the server.
Thankfully it was easy to restore.
Nuke the pkg and grab the code from git
Install the correct ruby version with rbenv
rbenv install 3.0.6
setup mastodon again (better check the project readme) with bunch of
bundle exec
incantations.The side effect of loosing packages was that we also don't have service files anymore. While there were @c@bow.st/110429847337542590">plenty of examples and help, we eventually ran it with supervisor with config, which is far simpler than service files IMO.
- mastodon-web
[program:mastodon_web]
command=/usr/local/www/mastodon/.rbenv/shims/bundle exec puma -C config/puma.rb ; the program (relative uses PATH, can take args)
directory=/usr/local/www/mastodon/live ; directory to cwd to before exec (def no cwd)
autostart=true ; start at supervisord start (default: true)
autorestart=true ; retstart at unexpected quit (default: true)
startsecs=10 ; number of secs prog must stay running (def. 1)
startretries=3 ; max # of serial start failures (default 3)
user=mastodon ; setuid to this UNIX account to run the program
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=/var/log/mastodon/web.log ; stdout log path, NONE for none; default AUTO
environment=RAILS_ENV=production,PATH=/usr/local/www/mastodon/.rbenv/shims:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
- sidekiq
[program:mastodon_sidekiq]
command=/usr/local/www/mastodon/.rbenv/shims/bundle exec sidekiq -c 25 ; the program (relative uses PATH, can take args)
directory=/usr/local/www/mastodon/live ; directory to cwd to before exec (def no cwd)
autostart=true ; start at supervisord start (default: true)
autorestart=true ; retstart at unexpected quit (default: true)
startsecs=10 ; number of secs prog must stay running (def. 1)
startretries=3 ; max # of serial start failures (default 3)
user=mastodon ; setuid to this UNIX account to run the program
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=/var/log/mastodon/sidekiq.log ; stdout log path, NONE for none; default AUTO
environment=RAILS_ENV=production,PATH=/usr/local/www/mastodon/.rbenv/shims:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
- mastodon streaming
[program:mastodon_streaming]
command=/usr/local/bin/node ./streaming ; the program (relative uses PATH, can take args)
directory=/usr/local/www/mastodon/live ; directory to cwd to before exec (def no cwd)
autostart=true ; start at supervisord start (default: true)
autorestart=true ; retstart at unexpected quit (default: true)
startsecs=10 ; number of secs prog must stay running (def. 1)
startretries=3 ; max # of serial start failures (default 3)
user=mastodon ; setuid to this UNIX account to run the program
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=/var/log/mastodon/streaming.log ; stdout log path, NONE for none; default AUTO
environment=NODE_ENV=production,PATH=/usr/local/www/mastodon/.rbenv/shims:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
Its all very janky and defintily a hotfix but it works for now. Maybe one of these days we will migrate to nomad.