前言
2周前安装了双实例,见: Redmine-4.1.1第二个实例(多实例)安装记录(Ubuntu20.04.2LTS) 但有一个遗留问题,个实例开机自启动脚本只能启动一个。解决了几次,今天终于找到原因解决了。
问题描述
# samxiao @ rm411 in ~ [15:03:09] $ cat auto-run-when-boot/xsz-boot.sh #! /bin/bash cd /home/samxiao/redmine-4.1.1-10086xsz bundle exec rails server thin -e production -p 10086 -d # bundle exec rails server thin -e production -p 10086 -l log/thin.log -d systemctl status thin # not plugins installed # x:88(0x58) cd /home/samxiao/redmine-4.1.1-no-plugins-installed-8801 bundle exec rails server thin -e production -p 8801 -d systemctl status thin
bundle exec rails server thin -e production -p 10086 -d
这一个没有启动。
手动执行以列命令是可以启动的
cd /home/samxiao/redmine-4.1.1-10086xsz bundle exec rails server thin -e production -p 10086 -d
解决办法:是插件CKEditor的Gemfile的问题, gem 'rich', path:'~/rich-1.5.2'
必须使用绝对路径
即将 ~/rich-1.5.2
改为/home/samxiao/rich-1.5.2
就行了。
原因:系统启动时还没有登录,实际是root用户。
~/rich-1.5.2
表示 /home/root/rich-1.5.2
,没有/home/root/rich-1.5.2
这个目录。
~/rich-1.5.2
是samxiao这个用户安装的, 在/home/samxiao/rich-1.5.2
下。
发现问题的过程,执行sudo /etc/rc.local时发现提示The path
/root/rich-1.5.2does not exist.
# samxiao @ rm411 in ~/auto-run-when-boot [9:52:39] $ sudo /etc/rc.local The path `/root/rich-1.5.2` does not exist. 13
# samxiao @ rm411 in ~/auto-run-when-boot [9:49:47] $ sudo /etc/rc.local The path `/root/rich-1.5.2` does not exist. # samxiao @ rm411 in ~/auto-run-when-boot [9:49:18] $ vi xsz-boot.sh # samxiao @ rm411 in ~/auto-run-when-boot [9:49:47] $ sudo /etc/rc.local The path `/root/rich-1.5.2` does not exist. # samxiao @ rm411 in ~/auto-run-when-boot [9:50:05] C:13 $ sudo vi /etc/rc.local # samxiao @ rm411 in ~/auto-run-when-boot [9:50:32] C:1 $ l total 16K drwxrwxr-x 2 samxiao samxiao 4.0K Mar 23 09:49 . drwxr-xr-x 23 samxiao samxiao 4.0K Mar 23 09:51 .. -rwxrwxr-x 1 samxiao samxiao 351 Mar 23 09:49 xsz-boot.sh -rw-r--r-- 1 samxiao samxiao 966 Feb 19 17:22 xsz.service # samxiao @ rm411 in ~/auto-run-when-boot [9:51:24] $ sudo vi /etc/rc.local # samxiao @ rm411 in ~/auto-run-when-boot [9:52:31] $ cat /etc/rc.local #! /bin/bash # cd /home/samxiao/redmine-4.1.1-10086xsz # bundle exec rails server thin -e production -p 10086 -d /home/samxiao/auto-run-when-boot/xsz-boot.sh # samxiao @ rm411 in ~/auto-run-when-boot [9:52:39] $ sudo /etc/rc.local The path `/root/rich-1.5.2` does not exist. 13 # samxiao @ rm411 in ~/redmine-4.1.1-10086xsz [9:55:16] C:130 $ find . -name "Gemfile"| xargs -i -t cat {} | grep "rich-1.5.2" cat ./plugins/redmine_dashboard/Gemfile cat ./plugins/redmine_serial_number_field/Gemfile cat ./plugins/redmine_more_previews/converters/cliff/Gemfile cat ./plugins/redmine_more_previews/converters/zippy/Gemfile cat ./plugins/redmine_more_previews/Gemfile cat ./plugins/additionals/Gemfile cat ./plugins/redmine_people/Gemfile cat ./plugins/redmine_dmsf/Gemfile cat ./plugins/redmine_knowledgebase/Gemfile cat ./plugins/custom_tables/Gemfile cat ./plugins/additional_tags/Gemfile cat ./plugins/redmine_questions/Gemfile cat ./plugins/redmine_ckeditor/Gemfile gem 'rich', path: '~/rich-1.5.2' cat ./plugins/redmine_favorite_projects/Gemfile cat ./Gemfile # source 'https://rubygems.org' 2 3 # gem 'rich', git: 'https://github.com/a-ono/rich.git', tag: '1.5.2' 4 gem 'rich', path: '~/rich-1.5.2' 5 gem 'kaminari' 6 gem 'htmlentities' 7 gem 'paperclip', '~> 6.1.0' 8 gem 'pandoc-ruby' 9 10 # It is needed for upgrading CKEditor 11 #gem 'sprockets-rails', '< 3.0.0'