问题
I followed Properly setting up Redis and Sidekiq in production on Ubuntu 16.04 to manage sidekiq worker
I created a file like
touch /lib/systemd/system/sidekiq.service
and added following content
[Unit]
Description=sidekiq
After=syslog.target network.target
[Service]
Type=simple
WorkingDirectory=/home/deploy/ezlarm-server/current
ExecStart=/home/deploy/.rbenv/shims/bundle exec "sidekiq -e production"
User=deploy
Group=deploy
UMask=0002
Environment=MALLOC_ARENA_MAX=2
RestartSec=1
Restart=on-failure
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sidekiq
[Install]
WantedBy=multi-user.target
Now when I run
systemctl {start,stop,status,restart} sidekiq
it gives following errors
回答1:
Maybe its too late but have you tried sudo systemctl {start,stop,status,restart} sidekiq
Faced the same issue but running the command with sudo
worked like a charm. Thanks.
来源:https://stackoverflow.com/questions/55365205/digital-ocean-manage-sidekiq-worker