After install Oxidized service can't start
Hello
I installed latest oxidized version on Centos 7, according to the instruction. I had to install ruby 2.3.7 using RVM (minimum version 2.3 required during installation). After installation, the manually running oxidized process works. But oxidized.service does not start. Please help. Below the necessary information.
oxidized: /usr/local/rvm/gems/ruby-2.3.7/bin/oxidized > only in this location
oxidized.service [Unit] Description=Oxidized - Network Device Configuration Backup Tool After=network-online.target multi-user.target Wants=network-online.target
[Service] ExecStart=/usr/local/rvm/gems/ruby-2.3.7/bin/oxidized User=root KillSignal=SIGKILL
[Install] WantedBy=multi-user.target
Error:
root@localhost system]# sudo systemctl status oxidized oxidized.service - Oxidized - Network Device Configuration Backup Tool Loaded: loaded (/etc/systemd/system/oxidized.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2018-10-19 10:00:25 CEST; 4s ago Process: 1614 ExecStart=/usr/local/rvm/gems/ruby-2.3.7/bin/oxidized (code=exited, status=1/FAILURE) Main PID: 1614 (code=exited, status=1/FAILURE)
Oct 19 10:00:24 localhost.localdomain systemd[1]: Starting Oxidized - Network Device Configuration Backup Tool...
Oct 19 10:00:25 localhost.localdomain oxidized[1614]: /usr/share/rubygems/rubygems/dependency.rb:296:in to_specs': Could not find 'oxidized' (>= 0.a) among 6 total gem(s) (Gem::LoadError)
Oct 19 10:00:25 localhost.localdomain oxidized[1614]: from /usr/share/rubygems/rubygems/dependency.rb:307:in to_spec'
Oct 19 10:00:25 localhost.localdomain oxidized[1614]: from /usr/share/rubygems/rubygems/core_ext/kernel_gem.rb:47:in gem'
Oct 19 10:00:25 localhost.localdomain oxidized[1614]: from /usr/local/rvm/gems/ruby-2.3.7/bin/oxidized:25:in eval'
Oct 19 10:00:25 localhost.localdomain oxidized[1614]: from /usr/local/bin/ruby_executable_hooks:24:in
`
Not sure how you installed oxidized. Im also running CentOS Linux release 7.5.1804 (Core)
but my service is like here: https://github.com/ytti/oxidized/blob/master/extra/oxidized.service
Did you follow these instructions? https://github.com/ytti/oxidized#centos-oracle-linux-red-hat-linux
ruby --version
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
I have the same issue, the latest version of oxidized does not work out of the box with CentOS due to prerequisite of some gems requiring higher version of ruby than the version installed by yum. This requires ruby installation via rvm and thus why the OP and myself are running oxidized from rvm directory.
Nevermind I managed to fix my install. Effectively you need to point it to the rvm wrapper of oxidized. To do this open up your etc/systemd/system/oxidized.service and change to the following:
execstart=/usr/local/rvm/gems/ruby-2.3.7/wrappers/oxidized
Thanks for the help. I Installed ruby using Rbenv method and now process works. I used instruction from this link https://linuxize.com/post/how-to-install-ruby-on-centos-7/