Start sidekiq automatically on OSX

坚强是说给别人听的谎言 提交于 2021-02-08 11:52:12

问题


I have coded up a small ruby gem that I use on my laptop to check disk space and other things.

I am using a sidekiq worker that runs periodically and emails me status updates.

I was wondering how to make a sidekiq worker run automatically after I restart OSX? Is this possible?

Cheers


回答1:


To run sidekiq you need to run: bundle exec sidekiq. If you want to run this on startup then you can follow these steps:

  1. Start Automator.app;
  2. Select "Application";
  3. Click "Show library" in the toolbar (if hidden);
  4. Add "Run shell script" (from the Actions/Utilities);
  5. Add script 'bundle exec sidekiq Or cd YOUR_APP_PATH&&bundle exec sidekiq;
  6. Test it;
  7. Save it somewhere: a file called your_name.app will be created);
  8. Go to System Preferences → Accounts → Login items;

More startup script options are here




回答2:


Launch Redis on computer (Mac) starts.

ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

Edit redis-server /usr/local/etc/redis.conf and set daemonize yes

After you saved file with this change just start server:

src/redis-server


来源:https://stackoverflow.com/questions/19361783/start-sidekiq-automatically-on-osx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!