Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
57b0a011
Commit
57b0a011
authored
4 years ago
by
Israel Barreto Sant'Anna
Browse files
Options
Downloads
Patches
Plain Diff
Added Sidekiq 6 new service and config files. Updated dalli store config for new version
parent
2d042293
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
config/environments/production.rb
+4
-1
4 additions, 1 deletion
config/environments/production.rb
export_env_vars.sh
+24
-0
24 additions, 0 deletions
export_env_vars.sh
portalmec-sidekiq.service
+72
-3
72 additions, 3 deletions
portalmec-sidekiq.service
sidekiq_log.conf
+4
-0
4 additions, 0 deletions
sidekiq_log.conf
with
104 additions
and
4 deletions
config/environments/production.rb
+
4
−
1
View file @
57b0a011
...
...
@@ -95,7 +95,10 @@ Rails.application.configure do
# Do not dump schema after migrations.
config
.
active_record
.
dump_schema_after_migration
=
false
config
.
cache_store
=
:dalli_store
,
nil
,
{
:namespace
=>
'portalmec'
,
:expires_in
=>
1
.
day
,
:compress
=>
true
,
:pool_size
=>
5
}
cache_store_servers
=
nil
cache_store_options
=
{
:namespace
=>
'portalmec'
,
:expires_in
=>
1
.
day
,
:compress
=>
true
,
:pool_size
=>
5
}
cache_store_args
=
[
cache_store_servers
,
cache_store_options
].
compact
config
.
cache_store
=
:mem_cache_store
,
*
cache_store_args
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
...
...
This diff is collapsed.
Click to expand it.
export_env_vars.sh
0 → 100755
+
24
−
0
View file @
57b0a011
#!/bin/bash
# Copyright (C) 2015 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana
#
# This file is part of portalmec.
#
# portalmec is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# portalmec is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with portalmec. If not, see <http://www.gnu.org/licenses/>.
ENV_VARS_PATH
=
/home/portalmec/portalmec/config/env_vars.sh
EXPORT_PATH
=
/home/portalmec/portalmec/env_vars.txt
grep
-o
'^[^#]*'
$ENV_VARS_PATH
|
cut
-d
' '
-f1
--complement
>
$EXPORT_PATH
This diff is collapsed.
Click to expand it.
portalmec-sidekiq.service
+
72
−
3
View file @
57b0a011
#
# This file tells systemd how to run Sidekiq as a 24/7 long-running daemon.
#
# Customize this file based on your bundler location, app directory, etc.
# Customize and copy this into /usr/lib/systemd/system (CentOS) or /lib/systemd/system or /etc/systemd/system (Debian).
# Then run:
# - systemctl enable sidekiq
# - systemctl {start,stop,restart} sidekiq
#
# This file corresponds to a single Sidekiq process. Add multiple copies
# to run multiple processes (sidekiq-1, sidekiq-2, etc).
#
# Use `journalctl -u sidekiq -rn 100` to view the last 100 lines of log output.
#
[Unit]
Description
=
Control sidekiq for portalmec
# start us only once the network and logging subsystems are available,
# consider adding redis-server.service if Redis is local and systemd-managed.
After
=
syslog.target network.target
# See these pages for lots of options:
#
# https://www.freedesktop.org/software/systemd/man/systemd.service.html
# https://www.freedesktop.org/software/systemd/man/systemd.exec.html
#
# THOSE PAGES ARE CRITICAL FOR ANY LINUX DEVOPS WORK; read them multiple
# times! systemd is a critical tool for all developers to know and understand.
#
[Service]
ExecStart
=
/portalmec/sidekiq.sh start
ExecStop
=
/portalmec/sidekiq.sh stop
#
# !!!! !!!! !!!!
#
# As of v6.0.6, Sidekiq automatically supports systemd's `Type=notify` and watchdog service
# monitoring. If you are using an earlier version of Sidekiq, change this to `Type=simple`
# and remove the `WatchdogSec` line.
#
# !!!! !!!! !!!!
#
Type
=
notify
NotifyAccess
=
all
# If your Sidekiq process locks up, systemd's watchdog will restart it within seconds.
WatchdogSec
=
10
WorkingDirectory
=
/home/portalmec/portalmec
# Export the environment variables in a readable format for systemd
ExecStartPre
=
/home/portalmec/portalmec/export_env_vars.sh
# If you use rbenv:
# ExecStart=/bin/bash -lc 'exec /home/deploy/.rbenv/shims/bundle exec sidekiq -e production'
# If you use the system's ruby:
# ExecStart=/usr/local/bin/bundle exec sidekiq -e production
# If you use rvm:
ExecStart
=
/home/portalmec/.rvm/gems/default/wrappers/bundle exec sidekiq -e production
# Use `systemctl kill -s TSTP sidekiq` to quiet the Sidekiq process
ExecStop
=
/bin/kill -s TSTP $MAINPID
# Greatly reduce Ruby memory fragmentation and heap usage
# https://www.mikeperham.com/2018/04/25/taming-rails-memory-bloat/
Environment
=
MALLOC_ARENA_MAX=2
# Load the envinroment variables exported in the ExecStartPre script
EnvironmentFile
=
/home/portalmec/portalmec/env_vars.txt
# if we crash, restart
RestartSec
=
10
Restart
=
on-failure
# output goes to /var/log/syslog (Debian) or /var/log/messages (CentOS)
StandardOutput
=
syslog
StandardError
=
syslog
# This will default to "bundler" if we don't specify it
SyslogIdentifier
=
sidekiq
[Install]
WantedBy
=
multi-user.target
WantedBy
=
multi-user.target
\ No newline at end of file
This diff is collapsed.
Click to expand it.
sidekiq_log.conf
0 → 100644
+
4
−
0
View file @
57b0a011
# Redirects sidekiq's service log from syslog to the sidekiq.log file
# Copy this file to /etc/rsyslog.d/sidekiq_log.conf
:
programname
,
isequal
,
"sidekiq"
/
home
/
portalmec
/
portalmec
/
shared
/
logs
/
sidekiq
.
log
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment